Implement scale in terms of scale_nonuniform

This commit is contained in:
Héctor Ramón Jiménez 2023-09-07 05:45:51 +02:00
parent 5371fae21a
commit 1f263051b6
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 2 additions and 4 deletions

View file

@ -155,7 +155,7 @@ impl Frame {
} }
pub fn scale(&mut self, scale: f32) { pub fn scale(&mut self, scale: f32) {
self.transform = self.transform.pre_scale(scale, scale); self.scale_nonuniform(Vector { x: scale, y: scale });
} }
pub fn scale_nonuniform(&mut self, scale: Vector) { pub fn scale_nonuniform(&mut self, scale: Vector) {

View file

@ -447,9 +447,7 @@ impl Frame {
/// Applies a uniform scaling to the current transform of the [`Frame`]. /// Applies a uniform scaling to the current transform of the [`Frame`].
#[inline] #[inline]
pub fn scale(&mut self, scale: f32) { pub fn scale(&mut self, scale: f32) {
self.transforms.current.raw = self.scale_nonuniform(Vector { x: scale, y: scale });
self.transforms.current.raw.pre_scale(scale, scale);
self.transforms.current.is_identity = false;
} }
/// Applies a non-uniform scaling to the current transform of the [`Frame`]. /// Applies a non-uniform scaling to the current transform of the [`Frame`].