Skip to content

Commit

Permalink
ComputedDistance for IntermediateTextShadow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroyuki Ikezoe committed Apr 24, 2017
1 parent 46e567e commit 0ec5a64
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -2660,7 +2660,7 @@ impl ComputeDistance for ClipRect {
}
}

impl ComputeDistance for TextShadow {
impl ComputeDistance for IntermediateTextShadow {
#[inline]
fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
self.compute_squared_distance(other).map(|sd| sd.sqrt())
Expand All @@ -2676,19 +2676,19 @@ impl ComputeDistance for TextShadow {
}
}

impl ComputeDistance for TextShadowList {
impl ComputeDistance for IntermediateTextShadowList {
#[inline]
fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
self.compute_squared_distance(other).map(|sd| sd.sqrt())
}

#[inline]
fn compute_squared_distance(&self, other: &Self) -> Result<f64, ()> {
let zero = TextShadow {
let zero = IntermediateTextShadow {
offset_x: Au(0),
offset_y: Au(0),
blur_radius: Au(0),
color: CSSParserColor::RGBA(RGBA::transparent()),
color: IntermediateColor::IntermediateRGBA(IntermediateRGBA::transparent()),
};

let max_len = cmp::max(self.0.len(), other.0.len());
Expand Down

0 comments on commit 0ec5a64

Please sign in to comment.