GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.3k stars 386 forks source link

Add alignment buttons popover option for alignment relative to artboard #1724

Closed nico-mayora closed 4 weeks ago

nico-mayora commented 2 months ago

Closes #1720.

This issue is still very much WIP--note the numerous debug! calls :^), but wanted to get this PR going as I have run into a small issue:

Note editor/src/messages/tool/tool_messages/select_tool.rs:173: I've made it so that if to_artboard is true, the alignment options are again enabled for just one selected object. In practise, this doesn't work--ticking the checkbox won't update the alignment buttons automatically. We need to reselect the object for the effect to take place. Is there a way this automatic refresh can be done?

Solved!

Keavon commented 2 months ago

!build

github-actions[bot] commented 2 months ago
📦 Build Complete for 559669174dfc14e5691364a590f20e0e68e54b0d
https://a2b8aa9f.graphite.pages.dev
Keavon commented 2 months ago

QA feedback:

nico-mayora commented 2 months ago

@Keavon

QA feedback:

* [ ]  A dash is shown in the dropdown menu until it is open. Only upon opening the menu is the dash replaced with the first item.

* [ ]  The list is not always populated with the current selection.

* [ ]  Let's use a three-way radio input to pick which alignment mode to use. "Selection" / "Layer" / "Artboard" can be the three choices.

I've pushed fixes for points 1 and 3, but can't manage to reproduce 2. Would you mind elaborating a bit more?

Keavon commented 2 months ago
nico-mayora commented 2 months ago

Artboard alignment should be relative to the parent artboard of each layer, not the last-selected artboard

What if the selection spans several artboards and "Preserve relative positions" is checked?

Keavon commented 2 months ago

Good question. Let's say it preserves relative positions of each per-artboard group of layers.