added a Frame::scale_nonuniform method

This commit is contained in:
ripytide 2023-09-05 10:49:50 +01:00
parent a56b25b909
commit 5371fae21a
No known key found for this signature in database
GPG key ID: B2629F9EC7C2FE8C
3 changed files with 20 additions and 2 deletions

View file

@ -158,6 +158,10 @@ impl Frame {
self.transform = self.transform.pre_scale(scale, scale);
}
pub fn scale_nonuniform(&mut self, scale: Vector) {
self.transform = self.transform.pre_scale(scale.x, scale.y);
}
pub fn into_primitive(self) -> Primitive {
Primitive::Clip {
bounds: Rectangle::new(Point::ORIGIN, self.size),