Make sure cursor rectangles are updated when view is moverd/resized

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25632 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-11-29 14:57:58 +00:00
parent db3d8f04bf
commit f57d5eaff9
2 changed files with 23 additions and 21 deletions

View file

@ -1,3 +1,8 @@
2007-11-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSView.m: Call ([resetCursorRects]) whenever view frame or
bounds are changed.
2007-11-29 Richard Frith-Macdonald <rfm@gnu.org> 2007-11-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSCursor.m: ([-initWithImage:]) changed to use a hot point * Source/NSCursor.m: ([-initWithImage:]) changed to use a hot point

View file

@ -1082,18 +1082,16 @@ GSSetDragTypes(NSView* obj, NSArray *types)
} }
} }
if (changedSize || changedOrigin) if (_coordinates_valid)
{ {
if (_coordinates_valid) (*invalidateImp)(self, invalidateSel);
{ }
(*invalidateImp)(self, invalidateSel); [self resetCursorRects];
} [self resizeSubviewsWithOldSize: old_size];
[self resizeSubviewsWithOldSize: old_size]; if (_post_frame_changes)
if (_post_frame_changes) {
{ [nc postNotificationName: NSViewFrameDidChangeNotification
[nc postNotificationName: NSViewFrameDidChangeNotification object: self];
object: self];
}
} }
} }
} }
@ -1107,7 +1105,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
(*invalidateImp)(self, invalidateSel); (*invalidateImp)(self, invalidateSel);
} }
_frame.origin = newOrigin; _frame.origin = newOrigin;
[self resetCursorRects];
if (_post_frame_changes) if (_post_frame_changes)
{ {
[nc postNotificationName: NSViewFrameDidChangeNotification [nc postNotificationName: NSViewFrameDidChangeNotification
@ -1151,7 +1149,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
{ {
_frame.size = _bounds.size = newSize; _frame.size = _bounds.size = newSize;
} }
[self resetCursorRects];
[self resizeSubviewsWithOldSize: old_size]; [self resizeSubviewsWithOldSize: old_size];
if (_post_frame_changes) if (_post_frame_changes)
{ {
@ -1181,9 +1179,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
[_frameMatrix rotateByDegrees: angle - oldAngle]; [_frameMatrix rotateByDegrees: angle - oldAngle];
_is_rotated_from_base = _is_rotated_or_scaled_from_base = YES; _is_rotated_from_base = _is_rotated_or_scaled_from_base = YES;
[self _updateBoundsMatrix]; [self _updateBoundsMatrix];
[self resetCursorRects];
if (_post_frame_changes) if (_post_frame_changes)
{ {
[nc postNotificationName: NSViewFrameDidChangeNotification [nc postNotificationName: NSViewFrameDidChangeNotification
@ -1320,7 +1317,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
[matrix invert]; [matrix invert];
[matrix boundingRectFor: frame result: &_bounds]; [matrix boundingRectFor: frame result: &_bounds];
RELEASE(matrix); RELEASE(matrix);
[self resetCursorRects];
if (_post_bounds_changes) if (_post_bounds_changes)
{ {
[nc postNotificationName: NSViewBoundsDidChangeNotification [nc postNotificationName: NSViewBoundsDidChangeNotification
@ -1341,7 +1338,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
[_boundsMatrix [_boundsMatrix
setFrameOrigin: NSMakePoint(-_bounds.origin.x, -_bounds.origin.y)]; setFrameOrigin: NSMakePoint(-_bounds.origin.x, -_bounds.origin.y)];
[self _updateBoundsMatrix]; [self _updateBoundsMatrix];
[self resetCursorRects];
if (_post_bounds_changes) if (_post_bounds_changes)
{ {
[nc postNotificationName: NSViewBoundsDidChangeNotification [nc postNotificationName: NSViewBoundsDidChangeNotification
@ -1373,7 +1370,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
[matrix invert]; [matrix invert];
[matrix boundingRectFor: frame result: &_bounds]; [matrix boundingRectFor: frame result: &_bounds];
RELEASE(matrix); RELEASE(matrix);
[self resetCursorRects];
if (_post_bounds_changes) if (_post_bounds_changes)
{ {
[nc postNotificationName: NSViewBoundsDidChangeNotification [nc postNotificationName: NSViewBoundsDidChangeNotification
@ -1392,7 +1389,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
_boundsMatrix = [NSAffineTransform new]; _boundsMatrix = [NSAffineTransform new];
} }
[_boundsMatrix setFrameOrigin: NSMakePoint(-newOrigin.x, -newOrigin.y)]; [_boundsMatrix setFrameOrigin: NSMakePoint(-newOrigin.x, -newOrigin.y)];
[self resetCursorRects];
if (_post_bounds_changes) if (_post_bounds_changes)
{ {
[nc postNotificationName: NSViewBoundsDidChangeNotification [nc postNotificationName: NSViewBoundsDidChangeNotification
@ -1423,7 +1420,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
_bounds.size = newSize; _bounds.size = newSize;
[self _updateBoundsMatrix]; [self _updateBoundsMatrix];
[self resetCursorRects];
if (_post_bounds_changes) if (_post_bounds_changes)
{ {
[nc postNotificationName: NSViewBoundsDidChangeNotification [nc postNotificationName: NSViewBoundsDidChangeNotification
@ -1457,7 +1454,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
[matrix invert]; [matrix invert];
[matrix boundingRectFor: frame result: &_bounds]; [matrix boundingRectFor: frame result: &_bounds];
RELEASE(matrix); RELEASE(matrix);
[self resetCursorRects];
if (_post_bounds_changes) if (_post_bounds_changes)
{ {
[nc postNotificationName: NSViewBoundsDidChangeNotification [nc postNotificationName: NSViewBoundsDidChangeNotification