Allow multiple nodes to be selected
EmNudge opened this issue · 1 comments
Motivation
Moving segments of a line over a bit is difficult, but sometimes necessary. If one must select each node a time, it is nearly impossible.
While it is not necessary to select nodes from multiple lines (rather the same line), this may also be useful.
There currently isn't any structure to even allow this, so we cannot just implement it. Once the structure is there, we should be able to select an entire line pretty easily.
Problems
This would be changing it from a single active node to a list of active nodes. If they are within the same segment, it won't be too difficult, but we probably want to allow at least an entire line to move as a unit. This means we will need to include more information in each array item - specifically the path.
In an object, we usually would include a list of strings. Instead here we would be including a list of symbols.
Something like:
// this would be wrapped in writable()
// the first element is the line. Then the segment. Then the node.
const activeNodes = [
[Symbol(), Symbol(), Symbol()],
[Symbol(), Symbol(), Symbol()],
[Symbol(), Symbol(), Symbol()],
]
Implementations
We would need:
- Shift-click - allows selecting multiple nodes manually
- box-select - similar to https://codesandbox.io/s/pixi-file-ui-c9bjo and desktops on most OS GUIs
- line-select - a button somewhere. Not sure if it should be the line in the line menu.