wheel cleanned

This commit is contained in:
Luis Fernando Molina committed 2020-03-15 14:37:53 +01:00
1 parent 1a4d84b088
commit c1e701d42e
2 files changed
-27

No files matched your search

-19
View File
@@ -24,7 +24,6 @@ function newFloatingLayer () {
removeFloatingObject: removeFloatingObject,
getFloatingObject: getFloatingObject,
physics: physics,
changeTargetRepulsion: changeTargetRepulsion,
draw: draw,
getContainer: getContainer,
initialize: initialize,
@@ -619,24 +618,6 @@ function newFloatingLayer () {
}
}
function changeTargetRepulsion (pDelta) {
try {
if (pDelta > 0) {
pDelta = 1
} else {
pDelta = -1
}
maxTargetRepulsionForce = maxTargetRepulsionForce + pDelta / 1000
if (maxTargetRepulsionForce < 0.0000000001) {
maxTargetRepulsionForce = 0.0000000001
}
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] changeTargetRepulsion -> err= ' + err.stack) }
}
}
function colliding (floatingObject1, floatingObject2) {
try {
/* This function detects weather 2 floatingObjects collide with each other. */
-8
View File
@@ -54,7 +54,6 @@ function newFloatingSpace () {
let visible = false
const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
let eventSubscriptionId
let onDragStartedEventSubscriptionId
let doubleClickCounter = 0
@@ -62,7 +61,6 @@ function newFloatingSpace () {
return thisObject
function finalize () {
thisObject.container.eventHandler.stopListening(eventSubscriptionId)
thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
thisObject.floatingLayer.finalize()
@@ -81,7 +79,6 @@ function newFloatingSpace () {
thisObject.uiObjectConstructor = newUiObjectConstructor()
thisObject.uiObjectConstructor.initialize(thisObject.floatingLayer)
eventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
onDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
}
@@ -292,11 +289,6 @@ function newFloatingSpace () {
return true
}
function onMouseWheel (event) {
if (visible === false) { return }
thisObject.floatingLayer.changeTargetRepulsion(event.wheelDelta)
}
function makeVisible () {
visible = true
}