katavorio icon indicating copy to clipboard operation
katavorio copied to clipboard

Wrong order of snapThreshold?

Open lordi opened this issue 6 years ago • 0 comments

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.

lordi avatar Dec 06 '17 15:12 lordi