mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 15:48:12 +08:00
Add a pivot widget to selected layer(s) to control the origin(s) (#772)
* Add pivot * Add dragging pivot * Cleanup * Remove tabs * Fix multiplication order * Restyle pivot * Add move cursor icon * Update pivot size * Code review tweaks * Fix alt with non-centred pivot * Comment for add one * Pivot sets layer panel origin * Tweek alt centre thing * Fix division by zero case * Add pivot dots to properties * FIx some typos Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
0f6f3be6e7
commit
1e109dc552
@@ -760,7 +760,12 @@ impl Document {
|
||||
self.mark_as_dirty(&path)?;
|
||||
Some([vec![DocumentChanged, LayerChanged { path: path.clone() }], update_thumbnails_upstream(&path)].concat())
|
||||
}
|
||||
|
||||
Operation::SetPivot { layer_path, pivot } => {
|
||||
let layer = self.layer_mut(&layer_path).expect("Setting pivot for invalid layer");
|
||||
layer.pivot = pivot.into();
|
||||
self.mark_as_dirty(&layer_path)?;
|
||||
Some([vec![DocumentChanged, LayerChanged { path: layer_path.clone() }], update_thumbnails_upstream(&layer_path)].concat())
|
||||
}
|
||||
Operation::SetLayerTransformInViewport { path, transform } => {
|
||||
let transform = DAffine2::from_cols_array(&transform);
|
||||
self.set_transform_relative_to_viewport(&path, transform)?;
|
||||
|
||||
Reference in New Issue
Block a user