Replace Primitive::Translate with Transform
This commit is contained in:
parent
759f0e9225
commit
5467c19c80
11 changed files with 205 additions and 133 deletions
|
|
@ -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()),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue