summaryrefslogtreecommitdiffstats
path: root/third_party/molokocacao/NSBezierPath+MCAdditions.m
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-15 01:09:56 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-15 01:09:56 +0000
commit830304fd8e1416e2d2e0c0bb0c291699f38f6bcc (patch)
tree88415c60d672c183779f4f32f8cb508bddcd9783 /third_party/molokocacao/NSBezierPath+MCAdditions.m
parente9d11291f9eb8352ccd04b5935426e3ffd1c76ec (diff)
downloadchromium_src-830304fd8e1416e2d2e0c0bb0c291699f38f6bcc.zip
chromium_src-830304fd8e1416e2d2e0c0bb0c291699f38f6bcc.tar.gz
chromium_src-830304fd8e1416e2d2e0c0bb0c291699f38f6bcc.tar.bz2
mac: Make tab close buttons look good in HiDPI
BUG=none TEST=close buttons look good Review URL: https://chromiumcodereview.appspot.com/10542172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/molokocacao/NSBezierPath+MCAdditions.m')
-rw-r--r--third_party/molokocacao/NSBezierPath+MCAdditions.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/molokocacao/NSBezierPath+MCAdditions.m b/third_party/molokocacao/NSBezierPath+MCAdditions.m
index e1771cc..250a3ba 100644
--- a/third_party/molokocacao/NSBezierPath+MCAdditions.m
+++ b/third_party/molokocacao/NSBezierPath+MCAdditions.m
@@ -92,7 +92,7 @@ static void CGPathCallback(void *info, const CGPathElement *element)
#endif // MCBEZIER_USE_PRIVATE_FUNCTION
}
-- (void)fillWithInnerShadow:(NSShadow *)shadow
+- (void)fillWithInnerShadow:(NSShadow *)shadow scale:(float)scale
{
[NSGraphicsContext saveGraphicsState];
@@ -100,7 +100,9 @@ static void CGPathCallback(void *info, const CGPathElement *element)
NSSize originalOffset = offset;
CGFloat radius = shadow.shadowBlurRadius;
NSRect bounds = NSInsetRect(self.bounds, -(ABS(offset.width) + radius), -(ABS(offset.height) + radius));
- offset.height += bounds.size.height;
+
+ // The context's user transform isn't automatically applied to shadow offsets.
+ offset.height += scale * bounds.size.height;
shadow.shadowOffset = offset;
NSAffineTransform *transform = [NSAffineTransform transform];
if ([[NSGraphicsContext currentContext] isFlipped])