diff --git a/.vs/AAWeb/v15/.suo b/.vs/AAWeb/v15/.suo index 29e42e45e..a5b7f4cbe 100644 Binary files a/.vs/AAWeb/v15/.suo and b/.vs/AAWeb/v15/.suo differ diff --git a/Canvas.js b/Canvas.js index 1c0562e62..eb5cb9267 100644 --- a/Canvas.js +++ b/Canvas.js @@ -151,7 +151,7 @@ function newCanvas() { /* We check first if the mouse is over a ball/ */ - ballBeingDragged = isInside(event.pageX, event.pageY); + ballBeingDragged = thisObject.floatingSpace.isInside(event.pageX, event.pageY); if (ballBeingDragged >= 0) { ballDragStarted = true; @@ -187,7 +187,7 @@ function newCanvas() { /* We check first if the mouse is over a ball/ */ - let ballBeingClicked = isInside(event.pageX, event.pageY); + let ballBeingClicked = thisObject.floatingSpace.isInside(event.pageX, event.pageY); if (ballBeingClicked >= 0) { @@ -247,7 +247,7 @@ function newCanvas() { if (ballDragStarted === true) { - if (isInsideBall(ballBeingDragged, event.pageX, event.pageY) === false) { + if (thisObject.floatingSpace.isInsideBall(ballBeingDragged, event.pageX, event.pageY) === false) { /* This means that the user stop moving the mouse and the ball ball out of the pointer. In this case we cancell the drag operation . */ @@ -273,7 +273,7 @@ function newCanvas() { browserCanvas.style.cursor = "grabbing"; thisObject.eventHandler.raiseEvent("Dragging", undefined); - let targetBall = isInside(event.pageX, event.pageY); + let targetBall = thisObject.floatingSpace.isInside(event.pageX, event.pageY); if (ballDragStarted) { @@ -384,7 +384,7 @@ function newCanvas() { var event = window.event || event; // old IE support let delta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail)); - let ballIndex = isInside(event.pageX, event.pageY); + let ballIndex = thisObject.floatingSpace.isInside(event.pageX, event.pageY); if (ballIndex >= 0) { diff --git a/FloatingSpace.js b/FloatingSpace.js index 8e4376648..359ef6c0b 100644 --- a/FloatingSpace.js +++ b/FloatingSpace.js @@ -9,6 +9,8 @@ function newFloatingSpace() { let thisObject = { physicsLoop: physicsLoop, + isInside: isInside, + isInsideBall: isInsideBall, balls: [], // <-- TODO: Check if this is really needed here. initialize: initialize };