mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Clamp perspective() values to a minimum of 1px
Differential Revision: https://phabricator.services.mozilla.com/D118250
This commit is contained in:
parent
2c5aa34bb0
commit
f81ffda69d
2 changed files with 4 additions and 11 deletions
|
@ -1204,8 +1204,8 @@ impl ComputeSquaredDistance for ComputedTransformOperation {
|
|||
// FIXME(emilio): Is this right? Why interpolating this with
|
||||
// Perspective but not with anything else?
|
||||
let mut p_matrix = Matrix3D::identity();
|
||||
if p.px() > 0. {
|
||||
p_matrix.m34 = -1. / p.px();
|
||||
if p.px() >= 0. {
|
||||
p_matrix.m34 = -1. / p.px().max(1.);
|
||||
}
|
||||
p_matrix.compute_squared_distance(&m)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue