mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Fix zero-area artboard
This commit is contained in:
@@ -236,7 +236,7 @@ impl Fsm for ArtboardToolFsmState {
|
||||
ArtboardMessage::AddArtboard {
|
||||
id: Some(id),
|
||||
position: (0., 0.),
|
||||
size: (0., 0.),
|
||||
size: (1., 1.),
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
|
||||
@@ -872,7 +872,13 @@ impl Document {
|
||||
Some([vec![DocumentChanged], update_thumbnails_upstream(&path)].concat())
|
||||
}
|
||||
Operation::SetLayerTransform { path, transform } => {
|
||||
let transform = DAffine2::from_cols_array(&transform);
|
||||
let mut transform = DAffine2::from_cols_array(&transform);
|
||||
if transform.x_axis[0] == 0. {
|
||||
transform.x_axis[0] = -1.
|
||||
}
|
||||
if transform.y_axis[1] == 0. {
|
||||
transform.y_axis[1] = -1.
|
||||
}
|
||||
let layer = self.layer_mut(&path)?;
|
||||
layer.transform = transform;
|
||||
self.mark_as_dirty(&path)?;
|
||||
|
||||
Reference in New Issue
Block a user