+- (void) drawRect:(CGRect)rect {
+ [text_ setScrollXOffset:origin_.x scrollYOffset:origin_.y];
+
+ CGRect draw(CGRectMake(0, 0, rect.size.width - rect.origin.x, rect.size.height - rect.origin.y));
+
+ CGContextSaveGState(context_); {
+ CGContextTranslateCTM(context_, rect.origin.x, rect.origin.y);
+
+ if (kCFCoreFoundationVersionNumber > 700)
+ [view_ _drawRect:draw context:context_ lockFocus:YES];
+ else {
+ WKView *view([view_ _viewRef]);
+ WKViewLockFocus$(view); {
+ WKViewDisplayRect$(view, draw);
+ } WKViewUnlockFocus$(view);
+ }
+ } CGContextRestoreGState(context_);
+}
+