CanvasSectionContainer: Drag distance check is updated.

It wasn't detecting negative values.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I93a633e84828ef18d1b4fc4246065421e63748b9
This commit is contained in:
Gökay Şatır 2021-02-16 16:55:06 +03:00 committed by Gökay ŞATIR
parent 219af45449
commit a591bc677f

View file

@ -316,7 +316,7 @@ class CanvasSectionContainer {
this.mousePosition = this.convertPositionToCanvasLocale(e);
if (this.positionOnMouseDown !== null && !this.draggingSomething) {
var dragDistance = [this.mousePosition[0] - this.positionOnMouseDown[0], this.mousePosition[1] - this.positionOnMouseDown[1]];
if (dragDistance[0] >= this.draggingTolerance || dragDistance[1] >= this.draggingTolerance) {
if (Math.abs(dragDistance[0]) >= this.draggingTolerance || Math.abs(dragDistance[1]) >= this.draggingTolerance) {
this.draggingSomething = true;
}
}