katavorio
katavorio copied to clipboard
Wrong order of snapThreshold?
It looks to me that currently snapThreshold is not respected if the grid is set.
In https://github.com/jsplumb/katavorio/blob/master/src/katavorio.js#L251 we see the following lines:
var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2
Wouldn't it make more sense to do
var tx = snapThreshold ? snapThreshold : this.params.grid ? this.params.grid[0] / 2 : DEFAULT_GRID_X / 2
in order to respect the snapThreshold when it is set? Right now there is no way of having a grid of 20px and a snapTheshold of 5px, because it will always take half of the grid size.