diff options
author | 2023-10-23 03:13:28 +0200 | |
---|---|---|
committer | 2024-02-02 01:53:23 +0100 | |
commit | 5467c19c80c992f03890264ed58156305a26b19a (patch) | |
tree | 141f48d4329ccb518d85fb121f51c22835744a11 /graphics/src/damage.rs | |
parent | 759f0e922598504705b543185bc7140a652b726a (diff) | |
download | iced-5467c19c80c992f03890264ed58156305a26b19a.tar.gz iced-5467c19c80c992f03890264ed58156305a26b19a.tar.bz2 iced-5467c19c80c992f03890264ed58156305a26b19a.zip |
Replace `Primitive::Translate` with `Transform`
Diffstat (limited to 'graphics/src/damage.rs')
-rw-r--r-- | graphics/src/damage.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/graphics/src/damage.rs b/graphics/src/damage.rs index ba9192ef..8edf69d7 100644 --- a/graphics/src/damage.rs +++ b/graphics/src/damage.rs @@ -102,10 +102,10 @@ impl<T: Damage> Damage for Primitive<T> { .fold(Rectangle::with_size(Size::ZERO), |a, b| { Rectangle::union(&a, &b) }), - Self::Translate { - translation, + Self::Transform { + transformation, content, - } => content.bounds() + *translation, + } => content.bounds() * *transformation, Self::Cache { content } => content.bounds(), Self::Custom(custom) => custom.bounds(), } @@ -144,19 +144,19 @@ fn regions<T: Damage>(a: &Primitive<T>, b: &Primitive<T>) -> Vec<Rectangle> { } } ( - Primitive::Translate { - translation: translation_a, + Primitive::Transform { + transformation: transformation_a, content: content_a, }, - Primitive::Translate { - translation: translation_b, + Primitive::Transform { + transformation: transformation_b, content: content_b, }, ) => { - if translation_a == translation_b { + if transformation_a == transformation_b { return regions(content_a, content_b) .into_iter() - .map(|r| r + *translation_a) + .map(|r| r * *transformation_a) .collect(); } } |