mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Fix hue adjustment to match the spec
The value to sum is tau, not pi. This was caught by some tests, see https://drafts.csswg.org/css-color/#shorter Differential Revision: https://phabricator.services.mozilla.com/D147006
This commit is contained in:
parent
1e5079ca00
commit
bc1845a8f8
1 changed files with 3 additions and 3 deletions
|
@ -432,9 +432,9 @@ fn adjust_hue(left: &mut f32, right: &mut f32, hue_interpolation: HueInterpolati
|
||||||
let delta = *right - *left;
|
let delta = *right - *left;
|
||||||
|
|
||||||
if delta > PI {
|
if delta > PI {
|
||||||
*left += PI;
|
*left += TAU;
|
||||||
} else if delta < -1. * PI {
|
} else if delta < -PI {
|
||||||
*right += PI;
|
*right += TAU;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// https://drafts.csswg.org/css-color/#longer
|
// https://drafts.csswg.org/css-color/#longer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue