diff --git a/ChartsSpace/EdgeEditor.js b/ChartsSpace/EdgeEditor.js index 06e82d9cb..c94b495fd 100644 --- a/ChartsSpace/EdgeEditor.js +++ b/ChartsSpace/EdgeEditor.js @@ -28,13 +28,6 @@ function newEdgeEditor () { let onMouseOverEventSubscriptionId let onMouseNotOverEventSubscriptionId - let mouse = { - position: { - x: 0, - y: 0 - } - } - return thisObject function finalize () { @@ -44,8 +37,6 @@ function newEdgeEditor () { thisObject.container.finalize() thisObject.container = undefined thisObject.fitFunction = undefined - - mouse = undefined } function initialize () { @@ -99,7 +90,39 @@ function newEdgeEditor () { } function physics () { - + if (thisObject.container.frame.position.x === 0 && thisObject.container.frame.position.y === 0) { return } + switch (whereIsMouseOver) { + case 'top' : { + thisObject.container.parentContainer.frame.position.y = thisObject.container.parentContainer.frame.position.y + thisObject.container.frame.position.y + thisObject.container.parentContainer.frame.height = thisObject.container.parentContainer.frame.height - thisObject.container.frame.position.y + thisObject.container.frame.position.x = 0 + thisObject.container.frame.position.y = 0 + thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event) + break + } + case 'bottom' : { + thisObject.container.parentContainer.frame.height = thisObject.container.parentContainer.frame.height + thisObject.container.frame.position.y + thisObject.container.frame.position.x = 0 + thisObject.container.frame.position.y = 0 + thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event) + break + } + case 'left' : { + thisObject.container.parentContainer.frame.position.x = thisObject.container.parentContainer.frame.position.x + thisObject.container.frame.position.x + thisObject.container.parentContainer.frame.width = thisObject.container.parentContainer.frame.width - thisObject.container.frame.position.x + thisObject.container.frame.position.x = 0 + thisObject.container.frame.position.y = 0 + thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event) + break + } + case 'right' : { + thisObject.container.parentContainer.frame.width = thisObject.container.parentContainer.frame.width + thisObject.container.frame.position.x + thisObject.container.frame.position.x = 0 + thisObject.container.frame.position.y = 0 + thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event) + break + } + } } function drawForeground () { diff --git a/ChartsSpace/TimeMachine.js b/ChartsSpace/TimeMachine.js index 99e663d52..dda14a48a 100644 --- a/ChartsSpace/TimeMachine.js +++ b/ChartsSpace/TimeMachine.js @@ -202,11 +202,11 @@ function newTimeMachine () { if (event.isUserAction === true) { let currentDate = getDateFromPoint(event.mousePosition, thisObject.container, timeMachineCoordinateSystem) let currentRate = getRateFromPoint(event.mousePosition, thisObject.container, timeMachineCoordinateSystem) - thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale + // thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale recalculateCoordinateSystem() moveToUserPosition(thisObject.container, currentDate, currentRate, timeMachineCoordinateSystem, false, true, event.mousePosition) } else { - thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale + // thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale recalculateCoordinateSystem() } thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event) @@ -277,9 +277,7 @@ function newTimeMachine () { container = thisObject.edgeEditor.getContainer(point) if (container !== undefined) { - if (container.isForThisPurpose(purpose)) { - return container - } + return container } if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { @@ -395,6 +393,8 @@ function newTimeMachine () { } function physics () { + thisObject.edgeEditor.physics() + saveFrame(thisObject.payload, thisObject.container.frame) if (thisObject.container.frame.isInViewPort()) { childrenPhysics()