Chromium Code Reviews| Index: third_party/apple_sample_code/ImageAndTextCell.m |
| diff --git a/third_party/apple_sample_code/ImageAndTextCell.m b/third_party/apple_sample_code/ImageAndTextCell.m |
| index e7e66640f8b60d86579189176c0777bcef1dca06..349cd454e6ff3fefd7740725291300dba3b05a0c 100644 |
| --- a/third_party/apple_sample_code/ImageAndTextCell.m |
| +++ b/third_party/apple_sample_code/ImageAndTextCell.m |
| @@ -122,15 +122,15 @@ |
| NSRectFill(imageFrame); |
| } |
| imageFrame.origin.x += 3; |
| + imageFrame.origin.y += ceil((cellFrame.size.height - imageSize.height) / 2); |
|
Robert Sesek
2012/07/17 21:41:34
Technically this should be std::ceil, but that'd r
|
| 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]; |
| } |