dikalo / lienzo-core

Lienzo Structure Graphics GWT Toolkit
Apache License 2.0
51 stars 58 forks source link

[Wires] Issues when using mediators (zoom, pan) #211

Closed romartin closed 6 years ago

romartin commented 6 years ago

When using mediators, like zooming or panning, some features are not working properly.

These are the identified issues:

Notice all above issues can even occur simultaneously when combining both panning and zooming ...

Related to https://issues.jboss.org/browse/JBPM-7118

danielzhe commented 6 years ago

I fixed the selection rectangle with panning on this commit (WIP).

About the zoom, I also fixed the wrong location too, changing WiresShapeHandler, line 140, to: control.onMove(event.getDragContext().getDistanceAdjusted().getX(), event.getDragContext().getDistanceAdjusted().getY());

It was using just getDragContext().getDy() before, not the distance adjusted.

But although now it drops on the correct location, it still doesn't find correct parent, for selection effect and for drop. :(

What I found out is that ColorMapBackedPicker, method findShapeAt (line 106), the x and y parameters are set with wrong values. If the zoom is little, the error is almost imperceptible. But if the zoom is bigger (zoom in or out), it becomes clear as we move the mouse while dragging.

So what I found is that the source of that wrong values is DragContext, method dragUpdate (line 176).

Just for debug purpose, I changed m_drag.adjust(m_lclp); to m_drag.adjust(new Point2D(m_dstx, m_dsty)); and it worked for highlight effect, but it breaks other features (like alignment).

I'm still investigating more.

Any ideas? Thank you!!

danielzhe commented 6 years ago

Fixed in #218 . It's working. @mdproctor

SprocketNYC commented 6 years ago

I’ve merged Mark’s latest PR, did some small cleanup, let me know when you want 2.0.300 to go out

Sent from my iPhone

On May 1, 2018, at 11:58 PM, Daniel J dos Santos notifications@github.com wrote:

Fixed in #218 . It's working. @mdproctor

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.