Conversation
|
Pinging @elastic/kibana-canvas |
💚 Build Succeeded |
|
This works as described and is a nice addition. In other vector editing tools, I've seen the ability to toggle the guides while dragging which is how I expected this to work (i.e. select, drag, then press Command to disable while dragging), whereas here you must press Command before you select/drag. I don't feel strongly enough that I would propose changing it, but perhaps others who review this will have an opinion. |
|
@ryankeairns thanks, valid point!
I just re-tested, it looks like the snap / no-snap behavior actually gets toggled, but it's only apparent once you then subsequently moved the mouse at least a little bit. The problem is that in JavaScript it's not possible to get a list of what keyboard buttons are down at a given time; I added state for that, but it got removed recently. I'm planning to add it back for this use case but as it's a smaller thing relative to this, and impacts the gesture handling (not the layouting as this PR), the plan is to make it a separate PR. |
|
Beautiful @monfera, I just tried it out. LGTM |
|
Nice change, ship it. |
|
@rashidkpc @timroes should it be backported to 6.5 and 6.x? |
|
6.x yes, 6.5 no. 6.5 should be limited to bug fixed |
(cherry picked from commit a92c649)
Closes #23978
Summary
Now, when dragging or resizing a Canvas element, its landmark points snap to landmark X/Y values of other shapes. So far, however, the element hasn't snapped to its former self. Reasons for adding self-snapping with this PR:
As with snapping in general, it can be deactivated with
Commandon the mac orAlton the PC (the snap lines still show).A future PR may add an actual indicator border for the former place of the element. But it'd be useful to merge as is, because every accidental minor drag&drop incurred on element selection incurs network traffic. So this issue partly addresses performance issues reported by @timroes
cc: @ryankeairns @alexfrancoeur
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately