From 70771a06cf0e597712b2d7215ec8d0c6bc9f1502 Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Sat, 14 Dec 2013 14:21:59 -0800 Subject: [PATCH] Make scrolling more robust on Mac --- src/NSObject+FrankAutomation.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NSObject+FrankAutomation.m b/src/NSObject+FrankAutomation.m index 4a87dae..b758897 100644 --- a/src/NSObject+FrankAutomation.m +++ b/src/NSObject+FrankAutomation.m @@ -709,14 +709,18 @@ @implementation NSScrollView (FrankAutomation) - (void) FEX_scrollToTop { [[self contentView] scrollToPoint: CGPointZero]; + + [self reflectScrolledClipView: [self contentView]]; } - (void) FEX_scrollToBottom { CGPoint maxContentOffset = CGPointZero; - maxContentOffset.y = [self contentSize].height - [self frame].size.height; + maxContentOffset.y = [[self contentView] documentRect].size.height - [self frame].size.height; [[self contentView] scrollToPoint: maxContentOffset]; + + [self reflectScrolledClipView: [self contentView]]; } @@ -724,6 +728,8 @@ - (void) FEX_setContentOffsetX: (NSInteger) x y: (NSInteger) y { [[self contentView] scrollToPoint: CGPointMake(x, y)]; + + [self reflectScrolledClipView: [self contentView]]; } @end