Fix extremely small pixel value for transform on Servo.

Sometimes, we want to use extremely small pixel value in transform, e.g.
translate(calc(0.001px)), which should be rendered correctly together
with scale(100000). This patch only fixes this case for Servo because
Stylo still uses Au on the Gecko side, even if we pass pixel value into
FFI directly in the previous patch.
This commit is contained in:
Boris Chiou 2017-09-08 18:08:20 +08:00
parent b89286e8e7
commit ce9f1ed143
3 changed files with 20 additions and 12 deletions

View file

@ -95,8 +95,8 @@ impl TransformList {
ComputedOperation::Translate(tx, ty, tz) => {
let (tx, ty) = match reference_box {
Some(relative_border_box) => {
(tx.to_used_value(relative_border_box.size.width).to_f32_px(),
ty.to_used_value(relative_border_box.size.height).to_f32_px())
(tx.to_pixel_length(relative_border_box.size.width).px(),
ty.to_pixel_length(relative_border_box.size.height).px())
},
None => {
// If we don't have reference box, we cannot resolve the used value,