HUGE BUG fixed, duplicating the creation of UI Objects
This commit is contained in:
1 parent
b6ca74d433
commit
a595d3f0a8
10 files changed
+150
-895
No files matched your search
@@ -188,8 +188,12 @@ function newFloatingObject () {
|
||||
if (thisObject.frozenManually !== false) { return }
|
||||
if (thisObject.payload === undefined) { return }
|
||||
let parent = thisObject.payload.chainParent
|
||||
if (parent !== undefined && parent.payload !== undefined) {
|
||||
thisObject.isFrozen = parent.payload.floatingObject.isFrozen
|
||||
if (parent !== undefined) {
|
||||
if (parent.payload !== undefined) {
|
||||
if (parent.payload.floatingObject !== undefined) {
|
||||
thisObject.isFrozen = parent.payload.floatingObject.isFrozen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,4 +483,3 @@ function newFloatingObject () {
|
||||
function updateRadius () {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,8 +227,10 @@ function newUiObject () {
|
||||
thisObject.payload.targetPosition.x = thisObject.payload.position.x,
|
||||
thisObject.payload.targetPosition.y = thisObject.payload.position.y
|
||||
} else {
|
||||
thisObject.payload.targetPosition.x = thisObject.payload.chainParent.payload.position.x
|
||||
thisObject.payload.targetPosition.y = thisObject.payload.chainParent.payload.position.y
|
||||
if (thisObject.payload.chainParent.payload.position !== undefined) {
|
||||
thisObject.payload.targetPosition.x = thisObject.payload.chainParent.payload.position.x
|
||||
thisObject.payload.targetPosition.y = thisObject.payload.chainParent.payload.position.y
|
||||
}
|
||||
}
|
||||
|
||||
if (thisObject.circularProgressBar !== undefined) {
|
||||
|
||||
@@ -31,14 +31,23 @@ function newUiObjectConstructor () {
|
||||
floatingObject.initialize('UI Object', payload)
|
||||
payload.floatingObject = floatingObject
|
||||
|
||||
if (payload.node.savedPayload !== undefined) {
|
||||
/*
|
||||
When this object is created based on a backup, share or clone, we will have a savedPayload that we will use to set the initial properties.
|
||||
If it is a new object being created out of the user interface, we jusst continue with the construction process.
|
||||
*/
|
||||
if (userAddingNew === false && payload.node.type !== 'Workspace') {
|
||||
let position = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
|
||||
position = {
|
||||
x: payload.node.savedPayload.position.x,
|
||||
y: payload.node.savedPayload.position.y
|
||||
}
|
||||
|
||||
if (position.x === null) { position.x = spawnPosition.x }
|
||||
if (position.y === null) { position.y = spawnPosition.y }
|
||||
// if (position.x === undefined) { position.x = spawnPosition.x }
|
||||
// if (position.y === undefined) { position.y = spawnPosition.y }
|
||||
|
||||
floatingObject.setPosition(position)
|
||||
payload.node.savedPayload.position = undefined
|
||||
@@ -56,8 +65,8 @@ function newUiObjectConstructor () {
|
||||
}
|
||||
}
|
||||
|
||||
/* For brand new objects being created directly by the user, we will make them inherit some properties from their parents. */
|
||||
if (userAddingNew === true) {
|
||||
/* For brand new objects being created directly by the user, we will make them inherit some properties from their parents. */
|
||||
if (payload.parentNode.payload.floatingObject.isTensed === true) {
|
||||
floatingObject.tensionToggle()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user