-
Notifications
You must be signed in to change notification settings - Fork 177
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
Fixed mouse offsets (and small other fixes) #348
base: master
Are you sure you want to change the base?
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
renderPreviewEdge
method 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.