From 41685949d7727814a1a94ae18dafb46a00d37dda Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 11 Feb 2020 13:53:55 +0100 Subject: [PATCH] Scale boxes working again --- ChartsSpace/EdgeEditor.js | 13 +++++++------ ChartsSpace/TimeMachine.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChartsSpace/EdgeEditor.js b/ChartsSpace/EdgeEditor.js index df2b922ca..ad013ce5a 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 = true + 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. let buttonUsedForDragging let isMouseOver @@ -69,7 +69,7 @@ function newEdgeEditor () { } } - function getContainer (event) { + function getContainer (event, purpose) { if (thisObject.container.frame.isThisPointHere(event, undefined, undefined, -EDGE_SIZE) === true && event.shiftKey !== true) { console.log('isThisPointHere ', true) @@ -100,11 +100,12 @@ function newEdgeEditor () { } whereIsMouseOver = 'center' - return thisObject.container - } else { - isMouseOver = false - whereIsMouseOver = 'outside' + if (thisObject.container.isForThisPurpose(purpose) === true) { + return thisObject.container + } } + isMouseOver = false + whereIsMouseOver = 'outside' } function physics () { diff --git a/ChartsSpace/TimeMachine.js b/ChartsSpace/TimeMachine.js index 287c4e7fa..4a58fb4a2 100644 --- a/ChartsSpace/TimeMachine.js +++ b/ChartsSpace/TimeMachine.js @@ -153,7 +153,7 @@ function newTimeMachine () { thisObject.edgeEditor = newEdgeEditor() thisObject.edgeEditor.initialize() - thisObject.edgeEditor.container.connectToParent(thisObject.container, true, true, false, true) + thisObject.edgeEditor.container.connectToParent(thisObject.container, true, true, false, true, true, true) callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE) } @@ -313,9 +313,15 @@ function newTimeMachine () { } } - container = thisObject.edgeEditor.getContainer(point) + container = thisObject.edgeEditor.getContainer(point, purpose) if (container !== undefined) { return container + } else { + if (thisObject.container.isForThisPurpose(purpose) === true) { + if (thisObject.container.frame.isThisPointHere(point) === true) { + return thisObject.container + } + } } }