mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make use of Either<A, B> for LengthOrNone
This commit is contained in:
parent
5df250bc05
commit
c4fc49c559
10 changed files with 21 additions and 116 deletions
|
@ -52,9 +52,8 @@ use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMod
|
|||
use style::properties::{self, ServoComputedValues};
|
||||
use style::properties::style_structs;
|
||||
use style::servo::restyle_damage::REPAINT;
|
||||
use style::values::RGBA;
|
||||
use style::values::computed;
|
||||
use style::values::computed::{Gradient, GradientKind, LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use style::values::{self, Either, RGBA, computed};
|
||||
use style::values::computed::{Gradient, GradientKind, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirection};
|
||||
use style_traits::cursor::Cursor;
|
||||
use table_cell::CollapsedBordersForCell;
|
||||
|
@ -1563,7 +1562,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
|
||||
let transform = self.transform_matrix(&border_box);
|
||||
let perspective = match self.style().get_effects().perspective {
|
||||
LengthOrNone::Length(d) => {
|
||||
Either::First(length) => {
|
||||
let perspective_origin = self.style().get_effects().perspective_origin;
|
||||
let perspective_origin =
|
||||
Point2D::new(model::specified(perspective_origin.horizontal,
|
||||
|
@ -1578,11 +1577,11 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
-perspective_origin.y,
|
||||
0.0);
|
||||
|
||||
let perspective_matrix = create_perspective_matrix(d);
|
||||
let perspective_matrix = create_perspective_matrix(length);
|
||||
|
||||
pre_transform.pre_mul(&perspective_matrix).pre_mul(&post_transform)
|
||||
}
|
||||
LengthOrNone::None => {
|
||||
Either::Second(values::None_) => {
|
||||
Matrix4D::identity()
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue