mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 23:36:12 +02:00
🎉 Render path fills
This commit is contained in:
parent
0bfcc1f854
commit
99bb3ee962
6 changed files with 118 additions and 90 deletions
|
@ -13,7 +13,7 @@ pub use paths::*;
|
|||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Kind {
|
||||
Rect,
|
||||
Rect(math::Rect),
|
||||
Path(Path),
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ impl Shape {
|
|||
Self {
|
||||
id,
|
||||
children: Vec::<Uuid>::new(),
|
||||
kind: Kind::Rect,
|
||||
kind: Kind::Rect(math::Rect::new_empty()),
|
||||
selrect: math::Rect::new_empty(),
|
||||
transform: Matrix::identity(),
|
||||
rotation: 0.,
|
||||
|
@ -73,6 +73,13 @@ impl Shape {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn set_selrect(&mut self, left: f32, top: f32, right: f32, bottom: f32) {
|
||||
self.selrect.set_ltrb(left, top, right, bottom);
|
||||
if let Kind::Rect(_) = self.kind {
|
||||
self.kind = Kind::Rect(self.selrect.to_owned());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn translation(&self) -> (f32, f32) {
|
||||
(self.transform.e, self.transform.f)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue