* Source/GSThemePrivate.h:

* Source/GSThemeTools.m:
	* Source/GSThemeDrawing.m: Add explicit isFlipped: param to
	-[GSDrawTiles contentRectForRect:]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37239 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2013-10-16 03:36:01 +00:00
parent 240f754c33
commit a11deb9ea1
4 changed files with 24 additions and 14 deletions

View file

@ -1355,7 +1355,8 @@ static NSImage *spinningImages[MaxCount];
withTiles: tiles
background: [NSColor clearColor]];
return [tiles contentRectForRect: bounds];
return [tiles contentRectForRect: bounds
isFlipped: [[NSView focusView] isFlipped]];
}
}
@ -1799,7 +1800,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
}
else
{
NSRect result = [tiles contentRectForRect: rect];
const BOOL flipped = [[cell controlView] isFlipped];
NSRect result = [tiles contentRectForRect: rect
isFlipped: flipped];
return result;
}
}
@ -2113,7 +2116,8 @@ typedef enum {
}
else
{
cRect = [tiles contentRectForRect: cRect];
cRect = [tiles contentRectForRect: cRect
isFlipped: [view isFlipped]];
}
return cRect;
}

View file

@ -113,8 +113,8 @@ typedef enum {
* drawn in the given rect, or NSZeroRect if the given rect is too small
* to draw the tiles in.
*/
- (NSRect) contentRectForRect: (NSRect)rect;
- (NSRect) contentRectForRect: (NSRect)rect
isFlipped: (BOOL)flipped;
/* Style drawing methods
*/
- (NSRect) noneStyleFillRect: (NSRect)rect;

View file

@ -1160,14 +1160,13 @@ withRepeatedImage: (NSImage*)image
}
- (NSRect) contentRectForRect: (NSRect)rect
isFlipped: (BOOL)flipped
{
GSThemeMargins margins = [self themeMargins];
// N.B. Assumes the caller is using unflipped coords.
rect.origin.x += margins.left;
rect.origin.y += margins.bottom;
rect.origin.y += flipped ? margins.top : margins.bottom;
rect.size.width -= (margins.left + margins.right);
rect.size.height -= (margins.top + margins.bottom);
@ -1176,7 +1175,7 @@ withRepeatedImage: (NSImage*)image
- (NSRect) noneStyleFillRect: (NSRect)rect
{
NSRect inFill = [self contentRectForRect: rect];
NSRect inFill = [self contentRectForRect: rect isFlipped: NO];
[self repeatFillRect: rect];
[self drawCornersRect: rect];
return inFill;
@ -1187,7 +1186,7 @@ withRepeatedImage: (NSImage*)image
BOOL flipped = [[GSCurrentContext() focusView] isFlipped];
NSRect r = rects[TileCM];
NSRect inFill = [self contentRectForRect: rect];
NSRect inFill = [self contentRectForRect: rect isFlipped: flipped];
[self repeatFillRect: rect];
[self drawCornersRect: rect];
@ -1211,7 +1210,7 @@ withRepeatedImage: (NSImage*)image
BOOL flipped = [[GSCurrentContext() focusView] isFlipped];
NSSize tsz = [self computeTotalTilesSize];
NSRect inFill = [self contentRectForRect: rect];
NSRect inFill = [self contentRectForRect: rect isFlipped: flipped];
[self repeatFillRect: rect];
[self drawCornersRect: rect];
@ -1230,7 +1229,7 @@ withRepeatedImage: (NSImage*)image
{
BOOL flipped = [[GSCurrentContext() focusView] isFlipped];
NSRect inFill = [self contentRectForRect: rect];
NSRect inFill = [self contentRectForRect: rect isFlipped: flipped];
NSImage *im = [images[TileCM] copy];
NSRect r = rects[TileCM];
@ -1274,7 +1273,7 @@ withRepeatedImage: (NSImage*)image
NSImage *img;
NSRect imgRect;
NSRect inFill = [self contentRectForRect: rect];
NSRect inFill = [self contentRectForRect: rect isFlipped: flipped];
[self scaleFillRect: rect];
[self drawCornersRect: rect];