From 13d635f673747d6f446a1e34ee05c4850f252df1 Mon Sep 17 00:00:00 2001 From: ericwa Date: Sat, 30 Apr 2011 06:40:14 +0000 Subject: [PATCH] * Source/NSView.m (-updateBoundsMatrix): Fix a bug where updateBoundsMatrix would refuse to restore a view's scale to its original value, after a modified bounds rect had been set. * Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:): Call [self setNeedsDisplay: YES]; at the ends of these methods. While the Cocoa docs explicitly say that calling these methods won't mark the view as needing redisplay, this doesn't seem to be true in practice. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32955 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 12 ++++++++++++ Source/NSView.m | 24 ++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fabdc558a..5008a8ea2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-04-30 Eric Wasylishen + + * Source/NSView.m (-updateBoundsMatrix): + Fix a bug where updateBoundsMatrix would refuse to restore a + view's scale to its original value, after a modified bounds rect + had been set. + * Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:): + Call [self setNeedsDisplay: YES]; at the ends of these methods. + While the Cocoa docs explicitly say that calling these methods + won't mark the view as needing redisplay, this doesn't seem to + be true in practice. + 2011-04-29 Eric Wasylishen * Source/NSOutlineView.m: Implement -keyDown: to expand/contract diff --git a/Source/NSView.m b/Source/NSView.m index 37df0d13f..460821f29 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -1137,13 +1137,13 @@ GSSetDragTypes(NSView* obj, NSArray *types) if (scale.width != 1 || scale.height != 1) { _is_rotated_or_scaled_from_base = YES; - - if (_boundsMatrix == nil) - { - _boundsMatrix = [NSAffineTransform new]; - } - [_boundsMatrix scaleTo: scale.width : scale.height]; } + + if (_boundsMatrix == nil) + { + _boundsMatrix = [NSAffineTransform new]; + } + [_boundsMatrix scaleTo: scale.width : scale.height]; } - (void) setFrame: (NSRect)frameRect @@ -1416,6 +1416,10 @@ GSSetDragTypes(NSView* obj, NSArray *types) object: self]; } } + + // FIXME: Should not be called here according to Cocoa docs, but + // Cocoa seems to in practice + [self setNeedsDisplay: YES]; } - (void) setBoundsOrigin: (NSPoint)newOrigin @@ -1436,6 +1440,10 @@ GSSetDragTypes(NSView* obj, NSArray *types) } [self translateOriginToPoint: NSMakePoint(oldOrigin.x - newOrigin.x, oldOrigin.y - newOrigin.y)]; + + // FIXME: Should not be called here according to Cocoa docs, but + // Cocoa seems to in practice + [self setNeedsDisplay: YES]; } - (void) setBoundsSize: (NSSize)newSize @@ -1473,6 +1481,10 @@ GSSetDragTypes(NSView* obj, NSArray *types) object: self]; } } + + // FIXME: Should not be called here according to Cocoa docs, but + // Cocoa seems to in practice + [self setNeedsDisplay: YES]; } - (void) setBoundsRotation: (float)angle