Pinning objects working
This commit is contained in:
1 parent
ef06f7bc8b
commit
21c22bf4a5
4 files changed
+88
-35
No files matched your search
@@ -19,6 +19,8 @@ function newFloatingObject () {
|
||||
rawMass: 0, // This is the mass value without zoom.
|
||||
rawRadius: 0, // This is the radius of this floating object without zoom.
|
||||
targetRadius: 0, // This is the target radius of the floating object with zoom applied. It should be animated until reaching this value.
|
||||
isPinned: undefined,
|
||||
pinToggle: pinToggle,
|
||||
physics: physics,
|
||||
initializeMass: initializeMass,
|
||||
initializeRadius: initializeRadius,
|
||||
@@ -95,6 +97,15 @@ function newFloatingObject () {
|
||||
}
|
||||
}
|
||||
|
||||
function pinToggle () {
|
||||
if (thisObject.isPinned !== true) {
|
||||
thisObject.isPinned = true
|
||||
thisObject.positionLocked = true
|
||||
} else {
|
||||
thisObject.isPinned = false
|
||||
}
|
||||
}
|
||||
|
||||
function physics () {
|
||||
thisObjectPhysics()
|
||||
thisObject.payload.uiObject.physics()
|
||||
@@ -171,7 +182,9 @@ function newFloatingObject () {
|
||||
|
||||
thisObject.payload.uiObject.container.eventHandler.raiseEvent('onNotFocus')
|
||||
|
||||
thisObject.positionLocked = false
|
||||
if (thisObject.isPinned !== true) {
|
||||
thisObject.positionLocked = false
|
||||
}
|
||||
thisObject.isOnFocus = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user