diff --git a/Canvas.js b/Canvas.js index e137a69c8..4f7f8c567 100644 --- a/Canvas.js +++ b/Canvas.js @@ -173,6 +173,7 @@ function newCanvas () { animation.addCallBackFunction('Panels Space', thisObject.panelsSpace.draw, onFunctionAdded) animation.addCallBackFunction('ViewPort Animate', viewPort.animate, onFunctionAdded) animation.addCallBackFunction('Bottom Space', thisObject.bottomSpace.draw, onFunctionAdded) + animation.addCallBackFunction('Bottom Space Physics', thisObject.bottomSpace.physics, onFunctionAdded) animation.addCallBackFunction('Top Space', thisObject.topSpace.draw, onFunctionAdded) animation.addCallBackFunction('Strategy Space', thisObject.strategySpace.draw, onFunctionAdded) animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw, onFunctionAdded) @@ -730,8 +731,12 @@ function newCanvas () { } if (containerBeingDragged !== undefined) { - containerBeingDragged.frame.position.x = containerBeingDragged.frame.position.x + displaceVector.x - containerBeingDragged.frame.position.y = containerBeingDragged.frame.position.y + displaceVector.y + if (containerBeingDragged.notDraggingOnX === false) { + containerBeingDragged.frame.position.x = containerBeingDragged.frame.position.x + displaceVector.x + } + if (containerBeingDragged.notDraggingOnY === false) { + containerBeingDragged.frame.position.y = containerBeingDragged.frame.position.y + displaceVector.y + } } } diff --git a/Container.js b/Container.js index b6ef7eace..88c619091 100644 --- a/Container.js +++ b/Container.js @@ -8,6 +8,8 @@ function newContainer () { eventHandler: undefined, parentContainer: undefined, isDraggeable: true, + notDraggingOnX: false, + notDraggingOnY: false, isClickeable: false, isWheelable: false, detectMouseOver: false, diff --git a/Spaces/BottomSpace.js b/Spaces/BottomSpace.js index 91fa400a4..3defae6e1 100644 --- a/Spaces/BottomSpace.js +++ b/Spaces/BottomSpace.js @@ -6,6 +6,7 @@ let thisObject = { container: undefined, draw: draw, + physics: physics, getContainer: getContainer, // returns the inner most container that holds the point received by parameter. createNewControl: createNewControl, destroyControl: destroyControl, @@ -18,6 +19,7 @@ thisObject.container.initialize(MODULE_NAME) thisObject.container.isClickeable = false thisObject.container.isDraggeable = true + thisObject.container.notDraggingOnX = true controlsMap = new Map() resize() @@ -44,6 +46,18 @@ // canvas.strategySpace.investmentPlanWorkspace.showUp() } + function resize () { + thisObject.container.frame.position.x = 0 + thisObject.container.frame.position.y = viewPort.visibleArea.bottomLeft.y + + thisObject.container.frame.width = browserCanvas.width + thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT + } + + function physics () { + + } + function createNewControl (pType, pDrawFunction, pOwner) { let control @@ -108,14 +122,6 @@ } } - function resize () { - thisObject.container.frame.position.x = 0 - thisObject.container.frame.position.y = viewPort.visibleArea.bottomLeft.y - - thisObject.container.frame.width = browserCanvas.width - thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT - } - function getContainer (point) { if (thisObject.container.frame.isThisPointHere(point, true) === true) { return thisObject.container