mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
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
This commit is contained in:
parent
29a9f0da46
commit
29105eeb49
1 changed files with 10 additions and 6 deletions
|
@ -363,9 +363,9 @@ impl PathCommand {
|
||||||
},
|
},
|
||||||
HorizontalLineTo { mut x, absolute } => {
|
HorizontalLineTo { mut x, absolute } => {
|
||||||
if !absolute.is_yes() {
|
if !absolute.is_yes() {
|
||||||
x += state.pos.0;
|
x += state.pos.x;
|
||||||
}
|
}
|
||||||
state.pos.0 = x;
|
state.pos.x = x;
|
||||||
HorizontalLineTo {
|
HorizontalLineTo {
|
||||||
x,
|
x,
|
||||||
absolute: IsAbsolute::Yes,
|
absolute: IsAbsolute::Yes,
|
||||||
|
@ -373,9 +373,9 @@ impl PathCommand {
|
||||||
},
|
},
|
||||||
VerticalLineTo { mut y, absolute } => {
|
VerticalLineTo { mut y, absolute } => {
|
||||||
if !absolute.is_yes() {
|
if !absolute.is_yes() {
|
||||||
y += state.pos.1;
|
y += state.pos.y;
|
||||||
}
|
}
|
||||||
state.pos.1 = y;
|
state.pos.y = y;
|
||||||
VerticalLineTo {
|
VerticalLineTo {
|
||||||
y,
|
y,
|
||||||
absolute: IsAbsolute::Yes,
|
absolute: IsAbsolute::Yes,
|
||||||
|
@ -613,6 +613,7 @@ impl IsAbsolute {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The path coord type.
|
/// The path coord type.
|
||||||
|
#[allow(missing_docs)]
|
||||||
#[derive(
|
#[derive(
|
||||||
AddAssign,
|
AddAssign,
|
||||||
Animate,
|
Animate,
|
||||||
|
@ -632,13 +633,16 @@ impl IsAbsolute {
|
||||||
ToShmem,
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct CoordPair(CSSFloat, CSSFloat);
|
pub struct CoordPair {
|
||||||
|
x: CSSFloat,
|
||||||
|
y: CSSFloat,
|
||||||
|
}
|
||||||
|
|
||||||
impl CoordPair {
|
impl CoordPair {
|
||||||
/// Create a CoordPair.
|
/// Create a CoordPair.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(x: CSSFloat, y: CSSFloat) -> Self {
|
pub fn new(x: CSSFloat, y: CSSFloat) -> Self {
|
||||||
CoordPair(x, y)
|
CoordPair { x, y }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue