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:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user