Fix Shift-drag axis color inconsistency and pivot not being draggable with a zero-width bounding box (#2593)

* Fix axis colors not being consistent and pivot not being draggable with zero width boxes

Fixes #2311

* Even for path
This commit is contained in:
mTvare
2025-04-17 13:45:08 -07:00
committed by GitHub
parent 41fe46591a
commit 29e8e8bdac
4 changed files with 30 additions and 29 deletions
@@ -35,7 +35,7 @@ impl Default for Pivot {
impl Pivot {
/// Calculates the transform that gets from normalized pivot to viewspace.
fn get_layer_pivot_transform(layer: LayerNodeIdentifier, document: &DocumentMessageHandler) -> DAffine2 {
let [min, max] = document.metadata().bounding_box_with_transform(layer, DAffine2::IDENTITY).unwrap_or_default();
let [min, max] = document.metadata().nonzero_bounding_box(layer);
let bounds_transform = DAffine2::from_translation(min) * DAffine2::from_scale(max - min);
let layer_transform = document.metadata().transform_to_viewport(layer);