From 03c8db171c73a8c8148cc2b922234c2b49877eb9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 11 Feb 2020 14:32:17 +0100 Subject: [PATCH] All ready to next phase --- Canvas.js | 2 +- ChartsSpace/EdgeEditor.js | 15 +++++++++------ ChartsSpace/TimeMachine.js | 4 ++-- Spaces/ChartSpace.js | 6 +----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Canvas.js b/Canvas.js index 49b3c3ab8..b365ca00b 100644 --- a/Canvas.js +++ b/Canvas.js @@ -522,7 +522,7 @@ function newCanvas () { /* we check if it is over any of the existing containers at the Chart Space. */ - container = thisObject.chartSpace.getContainer(point) + container = thisObject.chartSpace.getContainer(point, GET_CONTAINER_PURPOSE.DRAGGING) if (container !== undefined) { if (container.isDraggeable === true) { diff --git a/ChartsSpace/EdgeEditor.js b/ChartsSpace/EdgeEditor.js index ad013ce5a..53bd96910 100644 --- a/ChartsSpace/EdgeEditor.js +++ b/ChartsSpace/EdgeEditor.js @@ -20,7 +20,7 @@ function newEdgeEditor () { thisObject.container.isDraggeable = true thisObject.container.isClickeable = false thisObject.container.isWheelable = false - thisObject.container.detectMouseOver = false // The mouse over event will be detected by the Time Machine, and this container will get it because is connected to its parent. + thisObject.container.detectMouseOver = true let buttonUsedForDragging let isMouseOver @@ -100,12 +100,15 @@ function newEdgeEditor () { } whereIsMouseOver = 'center' - if (thisObject.container.isForThisPurpose(purpose) === true) { - return thisObject.container + switch (purpose) { + case GET_CONTAINER_PURPOSE.MOUSE_OVER: + return // We will let the Time Machine to handle this situation. + break + case GET_CONTAINER_PURPOSE.DRAGGING: + return thisObject.container + break } } - isMouseOver = false - whereIsMouseOver = 'outside' } function physics () { @@ -176,7 +179,7 @@ function newEdgeEditor () { let edgeSize let lineWidth - if (whereIsMouseOver === 'outside') { + if (whereIsMouseOver === 'outside' || isMouseOver === false) { edgeSize = EDGE_SIZE / 2 lineWidth = 0.1 } else { diff --git a/ChartsSpace/TimeMachine.js b/ChartsSpace/TimeMachine.js index 4a58fb4a2..0f8a215dd 100644 --- a/ChartsSpace/TimeMachine.js +++ b/ChartsSpace/TimeMachine.js @@ -64,7 +64,7 @@ function newTimeMachine () { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) thisObject.container.fitFunction = thisObject.fitFunction - thisObject.container.isDraggeable = true + thisObject.container.isDraggeable = false thisObject.container.insideViewport = true thisObject.container.detectMouseOver = true @@ -317,7 +317,7 @@ function newTimeMachine () { if (container !== undefined) { return container } else { - if (thisObject.container.isForThisPurpose(purpose) === true) { + if (thisObject.container.isForThisPurpose(purpose)) { if (thisObject.container.frame.isThisPointHere(point) === true) { return thisObject.container } diff --git a/Spaces/ChartSpace.js b/Spaces/ChartSpace.js index c7480606e..333b98fc5 100644 --- a/Spaces/ChartSpace.js +++ b/Spaces/ChartSpace.js @@ -133,11 +133,7 @@ function newChartSpace () { container = thisObject.timeMachines[i].getContainer(point, purpose) if (container !== undefined) { if (purpose !== undefined) { - if (container.isForThisPurpose(purpose)) { - if (thisObject.container.frame.isThisPointHere(point, true) === true) { - containerFound = container - } - } + containerFound = container } else { if (thisObject.container.frame.isThisPointHere(point, true) === true) { containerFound = container