Closed torbgy closed 5 years ago
No, this is not possible. In the current implementation, the dragged node positioned in the center of the closest grid (cell).
is this possible to get worked? whats the technical limitations?
It could be as simple as not adding 0.5
factor when the snap position is calculated (I think using Math.round
in this case makes more sense):
Test this and see if it has the effect you want (after modifying this line, snap during drag should snap to grid line as well).
This needs to be optional, so that one can switch between the original behavior and the new one. An option named snapToGridCenter
can be defined (the default value should be true
).
You can do a PR if you like.
Created PR https://github.com/iVis-at-Bilkent/cytoscape.js-grid-guide/pull/38 to address this with your implementation suggestion. It worked like a charm!
@torbgy this feature is now implemented. You can pull it from unstable branch.
Hows the release coming? I'm still using this featured as a one-off. Any updates on the next release?
Hi!
Is it possible to snap nodes to the gridline? like that the node is snapped to the cross of the gridline instead of the center of the cell?