Fixed mouse offsets (and small other fixes)#348
Fixed mouse offsets (and small other fixes)#348kelegorm wants to merge 5 commits intoflowhub:masterfrom
Conversation
|
To reproduce problem take |
I'd prefer this path, and pushing that responsibility / calculation to the parent app. Seems expensive to do it on every event, but let's look at numbers. Could you profile dragging a node in your version and compare? |
|
@forresto ok, I'll try. |
|
That issue is really annoying, please merge the guy's stuff. |
|
Unfortunately this does not merge cleanly due to other changes like Polymer removal and CommonJS module compatability. I'm OK with an updated PR using the existing approach (calling the calculation inside event handlers). |
|
It would be really helpful to have this fix asap. |
Fixed mouse offsets in all events. You can see issue when place the-graph in some position, not (0,0). In mouse events (context menu) there was not offset calculated, so context menu was in wrong place. Exception was in
renderPreviewEdgemethod where was used offsets likethis.props.app.state.offsetX, but it was useless - you have to set offsets manually.So I created method to recalculate offsets each time. It's causing some work for mouse events but it's absolutely automatic. I can rework all events to use
this.props.app.state.offsetX, but still problem is not solved until some recalculation for offsets is implemented.Other changes includes few code style fixes to make functions looks consistent.