diff options
Diffstat (limited to '')
-rw-r--r-- | servo/components/style/values/computed/box.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/servo/components/style/values/computed/box.rs b/servo/components/style/values/computed/box.rs index 62811d9851..0dea1c7ab9 100644 --- a/servo/components/style/values/computed/box.rs +++ b/servo/components/style/values/computed/box.rs @@ -383,6 +383,15 @@ impl Zoom { if self == Self::ONE { return value; } - self.value() * value + value * self.value() + } + + /// Returns the un-zoomed value. + #[inline] + pub fn unzoom(self, value: f32) -> f32 { + if self == Self::ONE { + return value; + } + value / self.value() } } |