Skip to content

Commit

Permalink
Only trigger NSClipView changes when setting new frame
Browse files Browse the repository at this point in the history
  • Loading branch information
williameveretteggplant committed Nov 4, 2024
1 parent 349dc21 commit 5ca02c9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Source/NSClipView.m
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,24 @@ - (void) setFrameOrigin: (NSPoint)aPoint

- (void) setFrame: (NSRect)rect
{
BOOL changedOrigin = NO;
BOOL changedSize = NO;
if (NSEqualPoints(_frame.origin, rect.origin) == NO)
{
changedOrigin = YES;
}
if (NSEqualSizes(_frame.size, rect.size) == NO)
{
changedSize = YES;
}
[super setFrame: rect];
[self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]];
[_super_view reflectScrolledClipView: self];

if (changedOrigin || changedSize)
{
NSPoint proposedPoint = [self constrainScrollPoint: _bounds.origin];
[self setBoundsOrigin: proposedPoint];
[_super_view reflectScrolledClipView: self];
}
}

- (void) translateOriginToPoint: (NSPoint)aPoint
Expand Down

0 comments on commit 5ca02c9

Please sign in to comment.