Warm up Floating Layer when a workspace is dropped

This commit is contained in:
Luis Fernando Molina committed 2019-12-02 19:16:57 +01:00
1 parent b082a32902
commit 69918eff2b
3 files changed
+17 -4

No files matched your search

+1
View File
@@ -205,6 +205,7 @@ function newWorkspace () {
if (droppedNode.type === 'Workspace') {
stopAllRunningTasks()
functionLibraryNodeDeleter.deleteWorkspace(thisObject.workspaceNode, thisObject.workspaceNode.rootNodes)
canvas.floatingSpace.warmUp()
thisObject.workspaceNode = droppedNode
functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode)
return
-3
View File
@@ -18,9 +18,6 @@ function newUiObjectConstructor () {
function finalize () {
floatingLayer = undefined
payload.uiObject.finalize()
payload.uiObject = undefined
}
function initialize (pFloatingLayer) {
+16 -1
View File
@@ -21,6 +21,7 @@ function newFloatingSpace () {
fitIntoVisibleArea: fitIntoVisibleArea,
isThisPointVisible: isThisPointVisible,
isItFar: isItFar,
warmUp: warmUp,
makeVisible: makeVisible,
makeInvisible: makeInvisible,
draw: draw,
@@ -50,14 +51,24 @@ function newFloatingSpace () {
let warmingUpCounter = 0
const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
let eventSubscriptionId
return thisObject
function finalize () {
thisObject.container.eventHandler.stopListening(eventSubscriptionId)
thisObject.floatingLayer.finalize()
thisObject.profileBalls.finalize()
thisObject.uiObjectConstructor.finalize()
thisObject.noteSets.finalize()
thisObject.container.finalize()
thisObject.floatingLayer = undefined
thisObject.profileBalls = undefined
thisObject.uiObjectConstructor = undefined
thisObject.noteSets = undefined
thisObject.container = undefined
}
function initialize (callBackFunction) {
@@ -73,7 +84,11 @@ function newFloatingSpace () {
thisObject.uiObjectConstructor = newUiObjectConstructor()
thisObject.uiObjectConstructor.initialize(thisObject.floatingLayer)
thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
eventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
}
function warmUp () {
warmingUpCounter = 0
}
function isItFar (payload, dontCheckParent) {