Commit 5e75d860 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Add RTL support for focus rings

We do not currently flip the canvas for focus rings when RTL is enabled.
This can cause certain focus rings to be drawn incorrectly for
their corresponding buttons.

Bug: 960284
Change-Id: I1144cee667c626e4978aaff9bd3cd8901494dbb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1696443Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677044}
parent 5a021593
......@@ -30,6 +30,7 @@ std::unique_ptr<FocusRing> FocusRing::Install(View* parent) {
auto ring = base::WrapUnique<FocusRing>(new FocusRing());
ring->set_owned_by_client();
parent->AddChildView(ring.get());
ring->EnableCanvasFlippingForRTLUI(parent->flip_canvas_on_paint_for_rtl_ui());
ring->InvalidateLayout();
ring->SchedulePaint();
return ring;
......@@ -101,6 +102,8 @@ void FocusRing::OnPaint(gfx::Canvas* canvas) {
path = GetHighlightPath(parent());
DCHECK(IsPathUseable(path));
DCHECK_EQ(flip_canvas_on_paint_for_rtl_ui(),
parent()->flip_canvas_on_paint_for_rtl_ui());
SkRect bounds;
SkRRect rbounds;
if (path.isRect(&bounds)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment