mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-15 13:04:29 +00:00
Fix for CPScrollView performance issue.
[#93 state:resolved] Reviewed by ross.
This commit is contained in:
1 parent
6b6a6a6f1d
commit
4d39466f14
2 files changed
+15
-30
No files matched your search
+15
-6
@@ -137,10 +137,7 @@ import "CPView.j"
|
||||
*/
|
||||
- (void)viewBoundsChanged:(CPNotification)aNotification
|
||||
{
|
||||
var superview = [self superview];
|
||||
|
||||
if([superview isKindOfClass:[CPScrollView class]])
|
||||
[superview reflectScrolledClipView:self];
|
||||
[self viewFrameChanged:aNotification];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -149,9 +146,21 @@ import "CPView.j"
|
||||
*/
|
||||
- (void)viewFrameChanged:(CPNotification)aNotification
|
||||
{
|
||||
var superview = [self superview];
|
||||
var oldScrollPoint = [self bounds].origin;
|
||||
|
||||
// Call scrollToPoint: because the current scroll point may no longer make
|
||||
// sense given the new frame of the document view.
|
||||
[self scrollToPoint:oldScrollPoint];
|
||||
|
||||
// scrollToPoint: takes care of reflectScrollClipView: for us, so bail if
|
||||
// the scroll points are not equal (meaning scrollToPoint: didn't early bail).
|
||||
if (!CGPointEqualToPoint(oldScrollPoint, [self bounds].origin))
|
||||
return;
|
||||
|
||||
if([superview isKindOfClass:[CPScrollView class]])
|
||||
// ... and we're in a scroll view of course.
|
||||
var superview = [self superview];
|
||||
|
||||
if ([superview isKindOfClass:[CPScrollView class]])
|
||||
[superview reflectScrolledClipView:self];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user