From 80883d716e4aa4eff3c27e3906241c30c12994a6 Mon Sep 17 00:00:00 2001 From: Marcian Lytwyn Date: Wed, 5 Oct 2016 22:33:28 +0000 Subject: [PATCH] Merge with trunk revision 40072 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40133 72102866-910b-0410-8b05-ffd578937521 --- Source/NSToolbar.m | 2 +- Source/NSView.m | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/NSToolbar.m b/Source/NSToolbar.m index 4b18c6591..5d05084a0 100644 --- a/Source/NSToolbar.m +++ b/Source/NSToolbar.m @@ -423,7 +423,7 @@ static GSValidationCenter *vc = nil; { GSValidationObject *vobj; NSMutableArray *observersWindow; - NSMutableArray *windows; + NSArray *windows; NSEnumerator *e; NSWindow *w; diff --git a/Source/NSView.m b/Source/NSView.m index 120514712..a6886ec98 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -1669,6 +1669,8 @@ static NSSize _computeScale(NSSize fs, NSSize bs) - (NSRect) centerScanRect: (NSRect)aRect { NSAffineTransform *matrix; + CGFloat x_org; + CGFloat y_org; /* * Hmm - we assume that the windows coordinate system is centered on the @@ -1683,10 +1685,12 @@ static NSSize _computeScale(NSSize fs, NSSize bs) aRect.size.height = -aRect.size.height; } + x_org = aRect.origin.x; + y_org = aRect.origin.y; aRect.origin.x = GSRoundTowardsInfinity(aRect.origin.x); - aRect.origin.y = GSRoundTowardsInfinity(aRect.origin.y); - aRect.size.width = GSRoundTowardsInfinity(aRect.size.width); - aRect.size.height = GSRoundTowardsInfinity(aRect.size.height); + aRect.origin.y = [self isFlipped] ? GSRoundTowardsNegativeInfinity(aRect.origin.y) : GSRoundTowardsInfinity(aRect.origin.y); + aRect.size.width = GSRoundTowardsInfinity(aRect.size.width + (x_org - aRect.origin.x) / 2.0); + aRect.size.height = GSRoundTowardsInfinity(aRect.size.height + (y_org - aRect.origin.y) / 2.0); matrix = [self _matrixFromWindow]; aRect.origin = [matrix transformPoint: aRect.origin]; @@ -2578,8 +2582,8 @@ static void autoresize(CGFloat oldContainerSize, * If the rect we are going to display contains the _invalidRect * then we can empty _invalidRect. Do this before the drawing, * as drawRect: may change this value. - * If the drawn rectangle cuts off a complete part of the - * _invalidRect, we should remove that part. + * FIXME: If the drawn rectangle cuts of a complete part of the + * _invalidRect, we should try to reduce this. */ if (NSEqualRects(aRect, NSUnionRect(neededRect, aRect)) == YES) { @@ -4543,7 +4547,7 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level) viewIsPrinting = nil; } -/* An exception occured while printing. Clean up */ +/* An exception occurred while printing. Clean up */ - (void) _cleanupPrinting { [self _invalidateCoordinates];