diff --git a/crates/epaint/src/mesh.rs b/crates/epaint/src/mesh.rs index 30b9c5a78f5..787c10d8200 100644 --- a/crates/epaint/src/mesh.rs +++ b/crates/epaint/src/mesh.rs @@ -268,6 +268,13 @@ impl Mesh { output } + /// Translate location by this much, in-place + pub fn translate(&mut self, delta: Vec2) { + for v in &mut self.vertices { + v.pos += delta; + } + } + /// Transform the mesh in-place with the given transform. pub fn transform(&mut self, transform: TSTransform) { for v in &mut self.vertices { diff --git a/crates/epaint/src/shape.rs b/crates/epaint/src/shape.rs index 0ebb07267b7..26e655f32d7 100644 --- a/crates/epaint/src/shape.rs +++ b/crates/epaint/src/shape.rs @@ -383,6 +383,8 @@ impl Shape { } Self::Text(text_shape) => { text_shape.pos = transform * text_shape.pos; + + // Scale text: let mut galley = (*text_shape.galley).clone(); for row in &mut galley.rows { for v in &mut row.visuals.mesh.vertices {