Replace Primitive::Translate with Transform

This commit is contained in:
Héctor Ramón Jiménez 2023-10-23 03:13:28 +02:00
parent 759f0e9225
commit 5467c19c80
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
11 changed files with 205 additions and 133 deletions

View file

@ -3,7 +3,7 @@ use crate::core::{Pixels, Point, Rectangle, Size, Vector};
use crate::graphics::geometry::fill::{self, Fill};
use crate::graphics::geometry::stroke::{self, Stroke};
use crate::graphics::geometry::{Path, Style, Text};
use crate::graphics::Gradient;
use crate::graphics::{Gradient, Transformation};
use crate::primitive::{self, Primitive};
pub struct Frame {
@ -181,8 +181,8 @@ impl Frame {
}
pub fn clip(&mut self, frame: Self, at: Point) {
self.primitives.push(Primitive::Translate {
translation: Vector::new(at.x, at.y),
self.primitives.push(Primitive::Transform {
transformation: Transformation::translate(at.x, at.y),
content: Box::new(frame.into_primitive()),
});
}