Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(784)

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainterMac.mm

Issue 2125533002: [Mac] Draw the caps lock indicator on the left side for RTL direction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a layout test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/caps-lock-indicator-enabled-rtl.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/ThemePainterMac.mm
diff --git a/third_party/WebKit/Source/core/paint/ThemePainterMac.mm b/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
index a71ea3a32ce975669c900baae2d31195fff7a806..1b35b809756e766f8463d96edeceb2704fd68022 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
+++ b/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
@@ -87,7 +87,7 @@
return false;
}
-bool ThemePainterMac::paintCapsLockIndicator(const LayoutObject&, const PaintInfo& paintInfo, const IntRect& r)
+bool ThemePainterMac::paintCapsLockIndicator(const LayoutObject& o, const PaintInfo& paintInfo, const IntRect& r)
{
// This draws the caps lock indicator as it was done by
// WKDrawCapsLockIndicator.
@@ -128,12 +128,14 @@
// Scale and translate the shape.
CGRect cgr = r;
CGFloat maxX = CGRectGetMaxX(cgr);
+ CGFloat minX = CGRectGetMinX(cgr);
CGFloat minY = CGRectGetMinY(cgr);
CGFloat heightScale = r.height() / kSquareSize;
+ bool isRTL = o.styleRef().direction() == RTL;
CGAffineTransform transform = CGAffineTransformMake(
heightScale, 0, // A B
0, heightScale, // C D
- maxX - r.height(), minY); // Tx Ty
+ isRTL ? minX : maxX - r.height(), minY); // Tx Ty
CGMutablePathRef paintPath = CGPathCreateMutable();
CGPathAddPath(paintPath, &transform, shape);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/caps-lock-indicator-enabled-rtl.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698