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

Don't outline hovered layers when box selecting #1707

Closed 0HyperCube closed 2 months ago

0HyperCube commented 3 months ago

Currently when box selecting with the select tool, the hovered layer is outlined. This is confusing as other layers that are also part of the box selection are not outlined. confusing outlining when box selection

To fix, the hovered layer should not be outlined when box selecting. Perhaps all the layers within the current box selection should instead be highlighted. The outline comes from overlay_context.outline in the SelectToolMessage::Overlays handler.

Keavon commented 3 months ago

We also want to outline the layers that are within the selection (where ending the selection immediately would cause them to become the selected layers).

shyamjayakannan commented 2 months ago

Hello @Keavon and @0HyperCube . I have made changes that won't outline the hovered layers while using box selection and will outline them when simply hovering otherwise.

However, as for outlining the layers within the selection, I don't know where/how to find out which layers will be selected when the mouse is released.

The layers that get selected on releasing the mouse are outlined by this I believe: https://github.com/GraphiteEditor/Graphite/blob/438c45eb802e75e41aad5ce0ab055c006563a334/editor/src/messages/tool/tool_messages/select_tool.rs#L393-L396

My question is, how do I find out which layers will be selected before the mouse is released

0HyperCube commented 2 months ago

@shyamjayakannan Thanks for your work on this. The code for selecting the required layers when the mouse is released is located in the select_tool.rs file as well, specifically: https://github.com/GraphiteEditor/Graphite/blob/438c45eb802e75e41aad5ce0ab055c006563a334/editor/src/messages/tool/tool_messages/select_tool.rs#L924-L926

shyamjayakannan commented 2 months ago

@Keavon and @0HyperCube please review #1727 when free