From 0f2ec900645c4fc5ef216f425598ff34664451a7 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sat, 14 Jun 2014 08:14:38 +0200 Subject: [PATCH] documentVisibleRect support --- AppKit/CPClipView.j | 5 +++++ AppKit/CPScrollView.j | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/AppKit/CPClipView.j b/AppKit/CPClipView.j index a59f83f12..7cc52d2bc 100644 --- a/AppKit/CPClipView.j +++ b/AppKit/CPClipView.j @@ -230,6 +230,11 @@ return [self scrollToPoint:CGPointMake(bounds.origin.x - deltaX, bounds.origin.y - deltaY)]; } +- (CGRect)documentVisibleRect +{ + return [self convertRect:[self bounds] fromView:_documentView]; +} + @end diff --git a/AppKit/CPScrollView.j b/AppKit/CPScrollView.j index 439489982..3ea8593b9 100644 --- a/AppKit/CPScrollView.j +++ b/AppKit/CPScrollView.j @@ -1262,6 +1262,10 @@ Notifies the delegate when the scroll view has finished scrolling. [self reflectScrolledClipView:_contentView]; } +- (CGRect)documentVisibleRect +{ + return [_contentView documentVisibleRect]; +} #pragma mark - #pragma mark Overrides