1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Enable clippy::iter_over_hash_type lint (#7421)

This helped discover a few things that _might_ have been buggy.
This commit is contained in:
Emil Ernerfeldt
2025-08-06 13:55:53 +02:00
committed by GitHub
parent d42ea3800f
commit 36a4981f29
22 changed files with 114 additions and 60 deletions

View File

@@ -127,6 +127,18 @@ pub struct ClippedShape {
pub shape: Shape,
}
impl ClippedShape {
/// Transform (move/scale) the shape in-place.
///
/// If using a [`PaintCallback`], note that only the rect is scaled as opposed
/// to other shapes where the stroke is also scaled.
pub fn transform(&mut self, transform: emath::TSTransform) {
let Self { clip_rect, shape } = self;
*clip_rect = transform * *clip_rect;
shape.transform(transform);
}
}
/// A [`Mesh`] or [`PaintCallback`] within a clip rectangle.
///
/// Everything is using logical points.

View File

@@ -416,7 +416,7 @@ impl Shape {
self.transform(TSTransform::from_translation(delta));
}
/// Move the shape by this many points, in-place.
/// Transform (move/scale) the shape in-place.
///
/// If using a [`PaintCallback`], note that only the rect is scaled as opposed
/// to other shapes where the stroke is also scaled.