Reverting to change prior to Doug/Paul/Marcian changes - flicker problem exists but clears on toggle of scaled/unscaled modes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38984 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-09-11 21:41:13 +00:00
parent 0aa1aae7d3
commit 6e13a48b13

View file

@ -79,9 +79,6 @@
#import "GSGuiPrivate.h"
#import "NSViewPrivate.h"
#define USE_INVALID_RECT_CLEANUP
/*
* We need a fast array that can store objects without retain/release ...
*/
@ -2548,9 +2545,6 @@ static void autoresize(CGFloat oldContainerSize,
flush = YES;
[_window disableFlushWindow];
aRect = NSIntersectionRect(aRect, visibleRect);
#if defined(USE_INVALID_RECT_CLEANUP)
aRect = NSIntegralRect(aRect);
#endif
neededRect = NSIntersectionRect(_invalidRect, visibleRect);
/*
@ -2560,52 +2554,11 @@ static void autoresize(CGFloat oldContainerSize,
* If the drawn rectangle cuts off a complete part of the
* _invalidRect, we should remove that part.
*/
#if defined(USE_INVALID_RECT_CLEANUP)
if (NSEqualRects(aRect, NSUnionRect(neededRect, aRect)) == YES || neededRect.size.width < 1 || neededRect.size.height < 1)
#else
if (NSEqualRects(aRect, NSUnionRect(neededRect, aRect)) == YES)
#endif
{
_invalidRect = NSZeroRect;
_rFlags.needs_display = NO;
}
#if defined(USE_INVALID_RECT_CLEANUP)
// Testplant-MAL-2015-07-08: keeping testplant branch code...
else
{
NSRectEdge sliceEdge = NSNotFound;
float distance = 0;
// check that intersection of aRect and _invalidRect either has an equal height or width to _invalidRect
// eg, if they are equal heights, we might be a slice on the left or right side
NSRect invalidAndRedrawn = NSIntersectionRect(aRect, neededRect);
if ( invalidAndRedrawn.size.height == neededRect.size.height ) {
// then check that aRect contains one of the side (corner?) points of _invalidRect (inclusive)
if ( NSPointInRect(NSMakePoint(NSMinX(neededRect), NSMidY(neededRect)), aRect) ) {
sliceEdge = NSMinXEdge;
distance = invalidAndRedrawn.size.width;
} else if ( NSPointInRect(NSMakePoint(NSMaxX(neededRect), NSMidY(neededRect)), aRect) ) {
sliceEdge = NSMaxXEdge;
distance = invalidAndRedrawn.size.width;
}
} else if ( invalidAndRedrawn.size.width == neededRect.size.width ) {
if ( NSPointInRect(NSMakePoint(NSMidX(neededRect), NSMinY(neededRect)), aRect) ) {
sliceEdge = NSMinYEdge;
distance = invalidAndRedrawn.size.height;
} else if ( NSPointInRect(NSMakePoint(NSMidX(neededRect), NSMaxY(neededRect)), aRect) ) {
sliceEdge = NSMaxYEdge;
distance = invalidAndRedrawn.size.height;
}
}
// remove the drawn area from _invalidRect
if ( sliceEdge != NSNotFound && fabsf(distance) >= 1 ) {
NSRect newInvalid;
NSDivideRect(_invalidRect, 0, &newInvalid, distance, sliceEdge);
_invalidRect = newInvalid;
}
}
#endif
}
if (NSIsEmptyRect(aRect) == NO)
@ -2616,9 +2569,6 @@ static void autoresize(CGFloat oldContainerSize,
[self _lockFocusInContext: context inRect: aRect];
[self drawRect: aRect];
[self unlockFocusNeedsFlush: flush];
#if !defined(USE_INVALID_RECT_CLEANUP)
_rFlags.needs_display = NO;
#endif
}
/*