mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Derive more.
Differential Revision: https://phabricator.services.mozilla.com/D17029
This commit is contained in:
parent
137e735d9d
commit
af1bbd7b06
8 changed files with 14 additions and 91 deletions
|
@ -9,13 +9,12 @@ use crate::values::CSSFloat;
|
|||
use num_traits::Zero;
|
||||
use std::f64::consts::PI;
|
||||
use std::fmt::{self, Write};
|
||||
use std::ops::Add;
|
||||
use std::{f32, f64};
|
||||
use style_traits::{CssWriter, ToCss};
|
||||
|
||||
/// A computed angle in degrees.
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
#[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero)]
|
||||
#[derive(Add, Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero)]
|
||||
pub struct Angle(CSSFloat);
|
||||
|
||||
impl ToCss for Angle {
|
||||
|
@ -66,15 +65,6 @@ impl Angle {
|
|||
}
|
||||
}
|
||||
|
||||
impl Add for Angle {
|
||||
type Output = Self;
|
||||
|
||||
#[inline]
|
||||
fn add(self, rhs: Self) -> Self {
|
||||
Angle(self.0 + rhs.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl Zero for Angle {
|
||||
#[inline]
|
||||
fn zero() -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue