Skip to content
This repository was archived by the owner on May 8, 2022. It is now read-only.
This repository was archived by the owner on May 8, 2022. It is now read-only.

Wrong order of snapThreshold? #40

@lordi

Description

@lordi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions