added a Frame::scale_nonuniform method
This commit is contained in:
parent
a56b25b909
commit
5371fae21a
3 changed files with 20 additions and 2 deletions
|
|
@ -444,7 +444,7 @@ impl Frame {
|
|||
self.transforms.current.is_identity = false;
|
||||
}
|
||||
|
||||
/// Applies a scaling to the current transform of the [`Frame`].
|
||||
/// Applies a uniform scaling to the current transform of the [`Frame`].
|
||||
#[inline]
|
||||
pub fn scale(&mut self, scale: f32) {
|
||||
self.transforms.current.raw =
|
||||
|
|
@ -452,6 +452,14 @@ impl Frame {
|
|||
self.transforms.current.is_identity = false;
|
||||
}
|
||||
|
||||
/// Applies a non-uniform scaling to the current transform of the [`Frame`].
|
||||
#[inline]
|
||||
pub fn scale_nonuniform(&mut self, scale: Vector) {
|
||||
self.transforms.current.raw =
|
||||
self.transforms.current.raw.pre_scale(scale.x, scale.y);
|
||||
self.transforms.current.is_identity = false;
|
||||
}
|
||||
|
||||
/// Produces the [`Primitive`] representing everything drawn on the [`Frame`].
|
||||
pub fn into_primitive(self) -> Primitive {
|
||||
Primitive::Group {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue