mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +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
77bec704cc
commit
7383ae4b49
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>
|
||||
|
||||
* Source/NSSegmentedCell.m (-initWithCoder:): Protect against
|
||||
|
|
|
@ -1094,6 +1094,7 @@ Fallback for backends other than Cairo. */
|
|||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
NSAffineTransform *transform;
|
||||
NSSize s;
|
||||
NSImageRep *rep;
|
||||
|
||||
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
|
||||
|| !srcRect.size.width || !srcRect.size.height)
|
||||
return;
|
||||
|
@ -1139,7 +1149,7 @@ Fallback for backends other than Cairo. */
|
|||
DPSrectclip(ctxt, dstRect.origin.x, dstRect.origin.y,
|
||||
dstRect.size.width, dstRect.size.height);
|
||||
DPSscale(ctxt, fx, fy);
|
||||
[self drawRepresentation: [self bestRepresentationForDevice: nil]
|
||||
[self drawRepresentation: rep
|
||||
inRect: NSMakeRect(p.x, p.y, s.width, s.height)];
|
||||
DPSgrestore(ctxt);
|
||||
|
||||
|
@ -1248,7 +1258,7 @@ Fallback for backends other than Cairo. */
|
|||
[_color set];
|
||||
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();
|
||||
|
||||
/* If we're doing a dissolve, use a DestinationIn composite to lower
|
||||
|
|
Loading…
Reference in a new issue