diff options
| author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-04 18:21:12 +0000 |
|---|---|---|
| committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-04 18:21:12 +0000 |
| commit | d60655b86f1d6a15e88ca51a77ccb7d3a3945612 (patch) | |
| tree | ef45576279e8b904b3ffb50a25df5401d9098ec4 /chrome/browser/cocoa/gradient_button_cell.mm | |
| parent | e9b084c2af3b8831f1d872691184da32e7df5b92 (diff) | |
| download | chromium_src-d60655b86f1d6a15e88ca51a77ccb7d3a3945612.zip chromium_src-d60655b86f1d6a15e88ca51a77ccb7d3a3945612.tar.gz chromium_src-d60655b86f1d6a15e88ca51a77ccb7d3a3945612.tar.bz2 | |
[Mac] Image-drawing which doesn't require image-flipping.
Snow Leopard deprecated -[NSImage setFlipped:] for good reasons. This
implements a method similar to the new
-[NSImage drawInRect:*:respectFlipped:] method, which allows images to
be drawn so that they always look right visually regardless of the
-isFlipped status of the view being drawn.
BUG=38943
TEST=Autocomplete, download, and reload button look right.
Review URL: http://codereview.chromium.org/2587003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/gradient_button_cell.mm')
| -rw-r--r-- | chrome/browser/cocoa/gradient_button_cell.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/gradient_button_cell.mm b/chrome/browser/cocoa/gradient_button_cell.mm index 002116d..ac71474 100644 --- a/chrome/browser/cocoa/gradient_button_cell.mm +++ b/chrome/browser/cocoa/gradient_button_cell.mm @@ -7,6 +7,7 @@ #include "base/logging.h" #import "base/scoped_nsobject.h" #import "chrome/browser/browser_theme_provider.h" +#import "chrome/browser/cocoa/image_utils.h" #import "chrome/browser/cocoa/themed_window.h" #include "grit/theme_resources.h" #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" @@ -415,11 +416,11 @@ static const NSTimeInterval kAnimationHideDuration = 0.4; NSRect imageRect = NSZeroRect; imageRect.size = [[self image] size]; NSRect drawRect = [self imageRectForBounds:cellFrame]; - [[self image] setFlipped:[controlView isFlipped]]; [[self image] drawInRect:drawRect fromRect:imageRect operation:NSCompositeSourceOver - fraction:[self isEnabled] ? 1.0 : 0.5]; + fraction:[self isEnabled] ? 1.0 : 0.5 + neverFlipped:YES]; if (isTemplate) { if (color) { [color set]; |
