Skip to content

Commit

Permalink
Fix cookie sheet icons.
Browse files Browse the repository at this point in the history
BUG=137201
TEST=as in bug


Review URL: https://chromiumcodereview.appspot.com/10793033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147130 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
avi@chromium.org committed Jul 17, 2012
1 parent 15b9ade commit 22ad694
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 7 additions & 7 deletions third_party/apple_sample_code/ImageAndTextCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSRectFill(imageFrame);
}
imageFrame.origin.x += 3;
imageFrame.origin.y += ceil((cellFrame.size.height - imageSize.height) / 2);
imageFrame.size = imageSize;

if ([controlView isFlipped]) {
imageFrame.origin.y += ceil((cellFrame.size.height + imageFrame.size.height) / 2);
} else {
imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2);
}

[image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver];
[image drawInRect:imageFrame
fromRect:NSZeroRect
operation:NSCompositeSourceOver
fraction:1.0
respectFlipped:YES
hints:nil];
}
[super drawWithFrame:cellFrame inView:controlView];
}
Expand Down
6 changes: 6 additions & 0 deletions third_party/apple_sample_code/README.chromium
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Name: Apple sample code
URL: http://developer.apple.com/
Version: unknown
Security Critical: Yes

Local changes:
* ImageAndTextCell.h: Changed 'image' property to 'retain' mode to fix a crash.
* ImageAndTextCell.m: Moved '@synthesize' to to the top of '@implementation' as
suggested by a clang warning.
* ImageAndTextCell.m: Switched from -[NSImage compositeToPoint:operation:] to
-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]
as the former is deprecated and doesn't work properly in
HiDPI.

0 comments on commit 22ad694

Please sign in to comment.