diff --git a/ChartingSpace/EdgeEditor.js b/ChartingSpace/EdgeEditor.js index e77516690..4759e9063 100644 --- a/ChartingSpace/EdgeEditor.js +++ b/ChartingSpace/EdgeEditor.js @@ -396,19 +396,26 @@ function newEdgeEditor () { break } case 'right' : { - if (thisObject.container.parentContainer.frame.width + dragVector.x < MIN_WIDTH && dragVector.x < 0) { - return + dragVectorWhenDragStarted.y = 0 + + let newWidth = dragVectorWhenDragStarted.x + parentFrameWhenDragStarted.width + if (newWidth < MIN_WIDTH && dragVectorWhenDragStarted.x < 0) { + dragVectorWhenDragStarted.x = MIN_WIDTH - parentFrameWhenDragStarted.width } let point = { - x: dragVector.x + thisObject.container.frame.width, - y: dragVector.y + x: dragVectorWhenDragStarted.x + parentFrameWhenDragStarted.width + parentFrameWhenDragStarted.position.x, + y: 0 } snapPointToGrid(point) - let newMaxDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem) + point.x = point.x - parentFrameWhenDragStarted.position.x thisObject.container.parentContainer.frame.width = point.x + /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */ + point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width) + let newMaxDate = point.x + switch (whatHappened) { case 'left mouse button': { coordinateSystem.max.x = newMaxDate.valueOf() diff --git a/Globals.js b/Globals.js index 1a1c76a6b..57706701e 100644 --- a/Globals.js +++ b/Globals.js @@ -213,7 +213,7 @@ const PERIOD_01_MIN = "01-min"; We define here the size of the chartingSpace. It has to bee enough big in order to accomodate all the charts we expect to display in this space. */ -const TIME_MACHINE_WIDTH = 320; +const TIME_MACHINE_WIDTH = 250; const TIME_MACHINE_HEIGHT = 120; let mediaRecorder // to downloadText canvas animation as a mediaRecorder