From 1f2e02ac79386cc96e131d3b381ab98658e7a5ba Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 21 Mar 2020 11:57:04 +0100 Subject: [PATCH] bug fixed --- ChartingSpace/EdgeEditor.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ChartingSpace/EdgeEditor.js b/ChartingSpace/EdgeEditor.js index c8d47b7ea..f45fea578 100644 --- a/ChartingSpace/EdgeEditor.js +++ b/ChartingSpace/EdgeEditor.js @@ -274,8 +274,8 @@ function newEdgeEditor () { thisObject.container.frame.position.x = 0 thisObject.container.frame.position.y = 0 - const MIN_WIDTH = 250 - const MIN_HEIGHT = 120 + const MIN_WIDTH = 200 + const MIN_HEIGHT = 100 switch (whereIsMouseOver) { case 'center': { @@ -493,8 +493,14 @@ function newEdgeEditor () { } function snapScalarToGrid (scalar) { + let sign + if (scalar < 0) { + sign = -1 + } else { + sign = 1 + } const GRID_SIZE = 10 - return Math.trunc(scalar / GRID_SIZE) * GRID_SIZE + GRID_SIZE / 2 + return Math.trunc(scalar / GRID_SIZE) * GRID_SIZE + GRID_SIZE / 2 * sign } }