Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enfore a stricter distance req for gl3d click events
  • Loading branch information
etpinard committed Feb 24, 2016
commit 2e63d1ec35c8f479486ad0e17c39b31e5c844531
11 changes: 8 additions & 3 deletions src/plots/gl3d/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ function render(scene) {
});
}

var eventType = (selection.buttons) ? 'plotly_click' : 'plotly_hover',
eventData = makeEventData(xVal, yVal, zVal, trace, selection);
var eventData = makeEventData(xVal, yVal, zVal, trace, selection);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just inline this? It doesn't seem to get used anywhere else (as far as I see so far) and if it does, we can make it a function later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call. Thanks!


if(selection.buttons && selection.distance < 5) {
scene.graphDiv.emit('plotly_click', eventData);
}
else {
scene.graphDiv.emit('plotly_hover', eventData);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

scene.graphDiv.emit(eventType, eventData);
oldEventData = eventData;
}
else {
Expand Down