Cleaning non used code
This commit is contained in:
1 parent
3757f8bbac
commit
a72115b1d4
2 files changed
+9
-48
No files matched your search
@@ -637,10 +637,10 @@ function newCanvas () {
|
||||
|
||||
event.mousePosition = point
|
||||
let container
|
||||
let panelContainer = canvas.panelsSpace.getContainer({ x: point.x, y: point.y })
|
||||
container = canvas.panelsSpace.getContainer({ x: point.x, y: point.y })
|
||||
|
||||
if (panelContainer !== undefined && panelContainer.isWheelable === true) {
|
||||
panelContainer.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
if (container !== undefined && container.isWheelable === true) {
|
||||
container.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
return false // This instructs the browser not to take the event and scroll the page.
|
||||
}
|
||||
|
||||
@@ -655,19 +655,19 @@ function newCanvas () {
|
||||
|
||||
/* We try the Bottom Space. */
|
||||
|
||||
let bottomContainer = canvas.bottomSpace.getContainer({ x: point.x, y: point.y })
|
||||
container = canvas.bottomSpace.getContainer({ x: point.x, y: point.y })
|
||||
|
||||
if (bottomContainer !== undefined && bottomContainer.isWheelable === true) {
|
||||
bottomContainer.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
if (container !== undefined && container.isWheelable === true) {
|
||||
container.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
return false // This instructs the browser not to take the event and scroll the page.
|
||||
}
|
||||
|
||||
/* Finally we try the Chart Space. */
|
||||
|
||||
let chartContainer = canvas.chartSpace.getContainer({ x: point.x, y: point.y }, GET_CONTAINER_PURPOSE.MOUSE_WHEEL)
|
||||
container = canvas.chartSpace.getContainer({ x: point.x, y: point.y }, GET_CONTAINER_PURPOSE.MOUSE_WHEEL)
|
||||
|
||||
if (chartContainer !== undefined && chartContainer.isWheelable === true) {
|
||||
chartContainer.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
if (container !== undefined && container.isWheelable === true) {
|
||||
container.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
return false // This instructs the browser not to take the event and scroll the page.
|
||||
} else {
|
||||
/* If all the above fails, we fallback into applying zoom to the viewPort */
|
||||
|
||||
@@ -26,8 +26,6 @@ function newFloatingLayer () {
|
||||
killFloatingObject: killFloatingObject,
|
||||
getFloatingObject: getFloatingObject,
|
||||
physics: physics,
|
||||
isInside: isInside,
|
||||
isInsideFloatingObject: isInsideFloatingObject,
|
||||
changeTargetRepulsion: changeTargetRepulsion,
|
||||
draw: draw,
|
||||
getContainer: getContainer,
|
||||
@@ -913,43 +911,6 @@ function newFloatingLayer () {
|
||||
}
|
||||
}
|
||||
|
||||
function isInside (x, y) {
|
||||
try {
|
||||
/* This function detects weather the point x,y is inside any of the floatingObjects. */
|
||||
|
||||
for (var i = 0; i < visibleFloatingObjects.length; i++) {
|
||||
var floatingObject = visibleFloatingObjects[i]
|
||||
var distance = Math.sqrt(Math.pow(floatingObject.container.frame.position.x - x, 2) + Math.pow(floatingObject.container.frame.position.y - y, 2))
|
||||
|
||||
if (distance < floatingObject.container.frame.radius) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] isInside -> err.message = ' + err.message) }
|
||||
}
|
||||
}
|
||||
|
||||
function isInsideFloatingObject (floatingObjectIndex, x, y) {
|
||||
try {
|
||||
if (INTENSIVE_LOG === true) { logger.write('[INFO] isInsideFloatingObject -> Entering function.') }
|
||||
|
||||
/* This function detects weather the point x,y is inside one particular floatingObjects. */
|
||||
|
||||
var floatingObject = visibleFloatingObjects[floatingObjectIndex]
|
||||
var distance = Math.sqrt(Math.pow(floatingObject.container.frame.position.x - x, 2) + Math.pow(floatingObject.container.frame.position.y - y, 2))
|
||||
|
||||
if (distance < floatingObject.container.frame.radius) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] isInsideFloatingObject -> err.message = ' + err.message) }
|
||||
}
|
||||
}
|
||||
|
||||
function distance (x1, y1, x2, y2) {
|
||||
try {
|
||||
if (INTENSIVE_LOG === true) { logger.write('[INFO] distance -> Entering function.') }
|
||||
|
||||
Reference in new issue
Block a user