From d379015d22ea58fb1e951a2e52f4969f50b5d0c4 Mon Sep 17 00:00:00 2001 From: ericwa Date: Sat, 12 Nov 2011 01:57:01 +0000 Subject: [PATCH] * Source/NSImage.m (-bestRepresentationForDevice:): When all other matching criteria fail, use the first image instead of the last (arbitrary, but seems to match cocoa.) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34166 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSImage.m | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04006753f..0952af65e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-11-11 Eric Wasylishen + + * Source/NSImage.m (-bestRepresentationForDevice:): When + all other matching criteria fail, use the first image instead + of the last (arbitrary, but seems to match cocoa.) + 2011-11-11 Eric Wasylishen * Source/NSAlert.m: Use NSImageScaleProportionallyUpOrDown on diff --git a/Source/NSImage.m b/Source/NSImage.m index 58e908252..2f0529796 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -1487,7 +1487,7 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep) NSArray *reps = [self _bestRepresentationsForDevice: deviceDescription]; /* If we have more than one match check for a representation whose size - * matches the image size exactly. Otherwise, arbitrarily choose the last + * matches the image size exactly. Otherwise, arbitrarily choose the first * representation. */ if ([reps count] > 1) { @@ -1502,7 +1502,7 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep) } } } - return [reps lastObject]; + return [reps objectAtIndex: 0]; } - (NSImageRep *) bestRepresentationForRect: (NSRect)rect