From 29105eeb4910daacbf90ae0e4ec3c243f85022fa Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 10 Mar 2023 19:19:28 +0000 Subject: [PATCH] style: Re-define CoordPair struct Redefine/Rename the fields in CoordPair to align the data members of gfx::Point. Differential Revision: https://phabricator.services.mozilla.com/D5903 --- components/style/values/specified/svg_path.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/components/style/values/specified/svg_path.rs b/components/style/values/specified/svg_path.rs index a6afc28b83a..29cab702c98 100644 --- a/components/style/values/specified/svg_path.rs +++ b/components/style/values/specified/svg_path.rs @@ -363,9 +363,9 @@ impl PathCommand { }, HorizontalLineTo { mut x, absolute } => { if !absolute.is_yes() { - x += state.pos.0; + x += state.pos.x; } - state.pos.0 = x; + state.pos.x = x; HorizontalLineTo { x, absolute: IsAbsolute::Yes, @@ -373,9 +373,9 @@ impl PathCommand { }, VerticalLineTo { mut y, absolute } => { if !absolute.is_yes() { - y += state.pos.1; + y += state.pos.y; } - state.pos.1 = y; + state.pos.y = y; VerticalLineTo { y, absolute: IsAbsolute::Yes, @@ -613,6 +613,7 @@ impl IsAbsolute { } /// The path coord type. +#[allow(missing_docs)] #[derive( AddAssign, Animate, @@ -632,13 +633,16 @@ impl IsAbsolute { ToShmem, )] #[repr(C)] -pub struct CoordPair(CSSFloat, CSSFloat); +pub struct CoordPair { + x: CSSFloat, + y: CSSFloat, +} impl CoordPair { /// Create a CoordPair. #[inline] pub fn new(x: CSSFloat, y: CSSFloat) -> Self { - CoordPair(x, y) + CoordPair { x, y } } }