summaryrefslogtreecommitdiffstats
path: root/third_party
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
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')
-rw-r--r--third_party/molokocacao/NSBezierPath+MCAdditions.h2
-rw-r--r--third_party/molokocacao/NSBezierPath+MCAdditions.m6
-rw-r--r--third_party/molokocacao/README.chromium2
3 files changed, 7 insertions, 3 deletions
diff --git a/third_party/molokocacao/NSBezierPath+MCAdditions.h b/third_party/molokocacao/NSBezierPath+MCAdditions.h
index 54ab2c6..eb64479 100644
--- a/third_party/molokocacao/NSBezierPath+MCAdditions.h
+++ b/third_party/molokocacao/NSBezierPath+MCAdditions.h
@@ -16,7 +16,7 @@
- (NSBezierPath*)pathWithStrokeWidth:(CGFloat)strokeWidth;
-- (void)fillWithInnerShadow:(NSShadow*)shadow;
+- (void)fillWithInnerShadow:(NSShadow *)shadow scale:(float)scale;
- (void)drawBlurWithColor:(NSColor*)color radius:(CGFloat)radius;
- (void)strokeInside;
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])
diff --git a/third_party/molokocacao/README.chromium b/third_party/molokocacao/README.chromium
index 53ed629..060b3cf 100644
--- a/third_party/molokocacao/README.chromium
+++ b/third_party/molokocacao/README.chromium
@@ -4,6 +4,7 @@ URL: http://www.seanpatrickobrien.com/journal/posts/3
Source URL: http://www.seanpatrickobrien.com/downloads/track/?path=%2Ftutorials%2F1%2FExampleButton.zip
Version: 1.0
License: BSD
+Security critical: YES
Description:
Additions to NSBezierPath to make certain operations more convenient (inner
@@ -12,3 +13,4 @@ shadows on paths, for example).
Local Modifications:
- Added LICENSE file based on email correspondence with Sean.
- Added header guards.
+ - Added a "scale:" parameter to fillWithInnerShadow:.