diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-01-16 17:46:27 +0100 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-01-26 08:59:21 +0100 |
commit | 423cc34cb00c698313c67a0edcbc6721ecf04f4f (patch) | |
tree | 46f5231f40db8052fc2979ab72594f1e44501136 /components/layout/query.rs | |
parent | 4f355f5877878bb2f4aed2b471e82722cd43f8e1 (diff) | |
download | servo-423cc34cb00c698313c67a0edcbc6721ecf04f4f.tar.gz servo-423cc34cb00c698313c67a0edcbc6721ecf04f4f.zip |
Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
applied on as a patch
- Update lyon_geom to the latest version
Major change:
- All matrices are now stored in row major order. This means that
parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
so `then()` is used and the order of operations changed.
Diffstat (limited to 'components/layout/query.rs')
-rw-r--r-- | components/layout/query.rs | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/components/layout/query.rs b/components/layout/query.rs index 10d652f3b12..ec3dd555ffc 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -15,7 +15,7 @@ use crate::opaque_node::OpaqueNodeMethods; use crate::sequential; use crate::wrapper::LayoutNodeLayoutData; use app_units::Au; -use euclid::default::{Point2D, Rect, Size2D, Vector2D}; +use euclid::default::{Box2D, Point2D, Rect, Size2D, Vector2D}; use euclid::Size2D as TypedSize2D; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::PipelineId; @@ -532,7 +532,35 @@ impl FragmentBorderBoxIterator for UnioningFragmentScrollAreaIterator { Point2D::new(left_margin, top_margin), Size2D::new(right_margin, bottom_margin), ); - self.union_rect = self.union_rect.union(&margin).union(&padding); + + // This is a workaround because euclid does not support unioning empty + // rectangles. + // TODO: The way that this iterator is calculating scroll area is very + // suspect and the code below is a workaround until it can be written + // in a better way. + self.union_rect = Box2D::new( + Point2D::new( + min( + padding.min_x(), + min(margin.min_x(), self.union_rect.min_x()), + ), + min( + padding.min_y(), + min(margin.min_y(), self.union_rect.min_y()), + ), + ), + Point2D::new( + max( + padding.max_x(), + max(margin.max_x(), self.union_rect.max_x()), + ), + max( + padding.max_y(), + max(margin.max_y(), self.union_rect.max_y()), + ), + ), + ) + .to_rect(); }, None => { self.level = Some(level); |