Implement Frame::clip for iced_tiny_skia

This commit is contained in:
Héctor Ramón Jiménez 2023-04-04 01:47:58 +02:00
parent 04c0ba04bf
commit 6fae8bf6cb
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -125,7 +125,12 @@ impl Frame {
self.transform = self.stack.pop().expect("Pop transform"); self.transform = self.stack.pop().expect("Pop transform");
} }
pub fn clip(&mut self, _frame: Self, _translation: Vector) {} pub fn clip(&mut self, frame: Self, translation: Vector) {
self.primitives.push(Primitive::Translate {
translation,
content: Box::new(frame.into_primitive()),
});
}
pub fn translate(&mut self, translation: Vector) { pub fn translate(&mut self, translation: Vector) {
self.transform = self.transform =