Fix Select tool's scale nudging with multi-layer selection (#1699)

* Fix scale nudging for multiple selection

* Use message discriminant for filtering where possible

* Remove unnecessary parameter from `selected_bounds_document_space`

* Fix the error `target.closest is not a function`

* Minor cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Elbert Ronnie
2024-03-26 01:50:30 +05:30
committed by GitHub
parent 0a9bd41be1
commit e9510c5fee
6 changed files with 41 additions and 29 deletions

View File

@@ -474,9 +474,7 @@ impl NodeGraphExecutor {
// Calculate the bounding box of the region to be exported
let bounds = match export_config.bounds {
ExportBounds::AllArtwork => document.metadata().document_bounds_document_space(!export_config.transparent_background),
ExportBounds::Selection => document
.metadata()
.selected_bounds_document_space(!export_config.transparent_background, document.metadata(), &document.selected_nodes),
ExportBounds::Selection => document.metadata().selected_bounds_document_space(!export_config.transparent_background, &document.selected_nodes),
ExportBounds::Artboard(id) => document.metadata().bounding_box_document(id),
}
.ok_or_else(|| "No bounding box".to_string())?;