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

Unified Diff: ui/gfx/paint_vector_icon.cc

Issue 2732493002: Vector icons: fix R_MOVE_TO after CLOSE (Closed)
Patch Set: move include Created 3 years, 10 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 | « ui/gfx/BUILD.gn ('k') | ui/gfx/paint_vector_icon_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/paint_vector_icon.cc
diff --git a/ui/gfx/paint_vector_icon.cc b/ui/gfx/paint_vector_icon.cc
index 7d1601dc4c0c363e3d483382a22553a3292635b0..2f5c762a9c9ebe3a70b89ed13a97643f6037552d 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -148,6 +148,13 @@ void PaintPath(Canvas* canvas,
}
case R_MOVE_TO: {
+ if (previous_command_type == CLOSE) {
+ // This triggers injectMoveToIfNeeded() so that the next subpath will
+ // start at the correct place. See
+ // [ https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand ].
+ path.rLineTo(0, 0);
+ }
+
SkScalar x = path_elements[++i].arg;
SkScalar y = path_elements[++i].arg;
path.rMoveTo(x, y);
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/paint_vector_icon_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698