-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make hosts sticky for valid attachments #368
Conversation
0c67f73
to
242f23d
Compare
@nikku I rewrote this PR so that it actually fixes the bpmn-js problem within diagram-js. Please feel free to leave your comments. |
This implements sticky attachers functionality.
242f23d
to
aec89d7
Compare
var shape = shapes[0], | ||
hostGfx; | ||
|
||
if (shape.host) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We offer the method Canvas#addMarker
and Canvas#removeMarker
to add temporary classes to an element. All related logic is also contained in both, Move and MovePreview.
From what it looked like the only thing that is missing is to reuse the logic is setting a valid hover target when starting the move operation. I've sketched that idea here.
Works fine in diagram-js, makes bpmn-js fail with two random test cases 😢.
I've spent way too much time today trying to dig into the root cause of these failures.
Let's keep this as is for now and see if we can improve things later!
Updated with minor changes, cf. aec89d7. |
The (potential) host's hit shape will now grow so that it gives a stickiness effect. When merged, this will fix bpmn-io/bpmn-js#1078.