mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 09:51:23 +00:00
* Source/NSImage.m: Use -bestRepresentationForRect:context:hints: in
-guiDrawInRect:... as well. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33308 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
66f70bb169
commit
ad79d99943
2 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2011-06-14 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSImage.m: Use -bestRepresentationForRect:context:hints: in
|
||||||
|
-guiDrawInRect:... as well.
|
||||||
|
|
||||||
2011-06-15 Fred Kiefer <FredKiefer@gmx.de>
|
2011-06-15 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSSegmentedCell.m (-initWithCoder:): Protect against
|
* Source/NSSegmentedCell.m (-initWithCoder:): Protect against
|
||||||
|
|
|
@ -1094,6 +1094,7 @@ Fallback for backends other than Cairo. */
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
NSAffineTransform *transform;
|
NSAffineTransform *transform;
|
||||||
NSSize s;
|
NSSize s;
|
||||||
|
NSImageRep *rep;
|
||||||
|
|
||||||
s = [self size];
|
s = [self size];
|
||||||
|
|
||||||
|
@ -1107,6 +1108,15 @@ Fallback for backends other than Cairo. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Choose a rep to use
|
||||||
|
|
||||||
|
rep = [self bestRepresentationForRect: dstRect
|
||||||
|
context: nil
|
||||||
|
hints: nil];
|
||||||
|
|
||||||
|
if (rep == nil)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!dstRect.size.width || !dstRect.size.height
|
if (!dstRect.size.width || !dstRect.size.height
|
||||||
|| !srcRect.size.width || !srcRect.size.height)
|
|| !srcRect.size.width || !srcRect.size.height)
|
||||||
return;
|
return;
|
||||||
|
@ -1139,7 +1149,7 @@ Fallback for backends other than Cairo. */
|
||||||
DPSrectclip(ctxt, dstRect.origin.x, dstRect.origin.y,
|
DPSrectclip(ctxt, dstRect.origin.x, dstRect.origin.y,
|
||||||
dstRect.size.width, dstRect.size.height);
|
dstRect.size.width, dstRect.size.height);
|
||||||
DPSscale(ctxt, fx, fy);
|
DPSscale(ctxt, fx, fy);
|
||||||
[self drawRepresentation: [self bestRepresentationForDevice: nil]
|
[self drawRepresentation: rep
|
||||||
inRect: NSMakeRect(p.x, p.y, s.width, s.height)];
|
inRect: NSMakeRect(p.x, p.y, s.width, s.height)];
|
||||||
DPSgrestore(ctxt);
|
DPSgrestore(ctxt);
|
||||||
|
|
||||||
|
@ -1248,7 +1258,7 @@ Fallback for backends other than Cairo. */
|
||||||
[_color set];
|
[_color set];
|
||||||
NSRectFill(NSMakeRect(0, 0, s.width, s.height));
|
NSRectFill(NSMakeRect(0, 0, s.width, s.height));
|
||||||
}
|
}
|
||||||
[[self bestRepresentationForDevice: nil] drawInRect: NSMakeRect(0, 0, s.width, s.height)];
|
[rep drawInRect: NSMakeRect(0, 0, s.width, s.height)];
|
||||||
PSgrestore();
|
PSgrestore();
|
||||||
|
|
||||||
/* If we're doing a dissolve, use a DestinationIn composite to lower
|
/* If we're doing a dissolve, use a DestinationIn composite to lower
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue