mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Bugfix for views occasionally being thought to be updated prematurely
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5364 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f14fdd88a4
commit
76c1535542
2 changed files with 29 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
|||
Thu Dec 2 17:02:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSView.m: ([-displayRectIgnoringOpacity:]) and
|
||||
([-displayIfNeededInRectIgnoringOpacity:]) - very tricksy fix so that
|
||||
views are still marked as needing display if any of their subviews
|
||||
need displaying (though the invalid rectangle may be zeroed if all
|
||||
the stuff at this level has been drawn).
|
||||
|
||||
Thu Dec 2 11:00:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSMenuView.m: ([-trackWithEvent:]) Removed spurious code
|
||||
|
|
|
@ -1446,6 +1446,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
|
||||
if (_rFlags.needs_display)
|
||||
{
|
||||
BOOL subviewNeedsDisplay = NO;
|
||||
NSRect neededRect;
|
||||
NSRect redrawRect;
|
||||
|
||||
if (coordinates_valid == NO)
|
||||
|
@ -1453,6 +1455,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
|
||||
aRect = NSIntersectionRect(aRect, visibleRect);
|
||||
redrawRect = NSIntersectionRect(aRect, invalidRect);
|
||||
neededRect = NSIntersectionRect(visibleRect, invalidRect);
|
||||
|
||||
if (NSIsEmptyRect(redrawRect) == NO)
|
||||
{
|
||||
|
@ -1513,6 +1516,10 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
fromView: self];
|
||||
}
|
||||
[subview displayIfNeededInRectIgnoringOpacity: isect];
|
||||
if (subview->_rFlags.needs_display)
|
||||
{
|
||||
subviewNeedsDisplay = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1520,14 +1527,13 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
|
||||
/*
|
||||
* If the rect we displayed contains the invalidRect or visibleRect
|
||||
* then we can empty invalidRect. All subviews will have been
|
||||
* then we can empty invalidRect. If all subviews have been
|
||||
* fully displayed, so this view no longer needs to be displayed.
|
||||
*/
|
||||
if (NSEqualRects(aRect, NSUnionRect(invalidRect, aRect)) == YES
|
||||
|| NSEqualRects(aRect, NSUnionRect(visibleRect, aRect)) == YES)
|
||||
if (NSEqualRects(aRect, NSUnionRect(neededRect, aRect)) == YES)
|
||||
{
|
||||
invalidRect = NSZeroRect;
|
||||
_rFlags.needs_display = NO;
|
||||
_rFlags.needs_display = subviewNeedsDisplay;
|
||||
}
|
||||
[window flushWindow];
|
||||
}
|
||||
|
@ -1550,6 +1556,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
|
||||
- (void) displayRectIgnoringOpacity: (NSRect)aRect
|
||||
{
|
||||
BOOL subviewNeedsDisplay = NO;
|
||||
NSRect neededRect;
|
||||
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
|
@ -1557,6 +1566,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
[self _rebuildCoordinates];
|
||||
|
||||
aRect = NSIntersectionRect(aRect, visibleRect);
|
||||
neededRect = NSIntersectionRect(invalidRect, visibleRect);
|
||||
|
||||
if (NSIsEmptyRect(aRect) == NO)
|
||||
{
|
||||
|
@ -1616,6 +1626,10 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
fromView: self];
|
||||
}
|
||||
[subview displayIfNeededInRectIgnoringOpacity: isect];
|
||||
if (subview->_rFlags.needs_display)
|
||||
{
|
||||
subviewNeedsDisplay = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1623,14 +1637,13 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
|
||||
/*
|
||||
* If the rect we displayed contains the invalidRect or visibleRect
|
||||
* then we can empty invalidRect. All subviews will have been
|
||||
* then we can empty invalidRect. If all subviews have been
|
||||
* fully displayed, so this view no longer needs to be displayed.
|
||||
*/
|
||||
if (NSEqualRects(aRect, NSUnionRect(invalidRect, aRect)) == YES
|
||||
|| NSEqualRects(aRect, NSUnionRect(visibleRect, aRect)) == YES)
|
||||
if (NSEqualRects(aRect, NSUnionRect(neededRect, aRect)) == YES)
|
||||
{
|
||||
invalidRect = NSZeroRect;
|
||||
_rFlags.needs_display = NO;
|
||||
_rFlags.needs_display = subviewNeedsDisplay;
|
||||
}
|
||||
[window flushWindow];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue