Inheritance of UIObject properties when adding new ones
This commit is contained in:
1 parent
24d2443c1a
commit
419107a38d
2 files changed
+208
-192
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -27,7 +27,7 @@ function newUiObjectConstructor () {
|
||||
floatingLayer = pFloatingLayer
|
||||
}
|
||||
|
||||
function createUiObject (payload) {
|
||||
function createUiObject (userAddingNew, payload) {
|
||||
let floatingObject = newFloatingObject()
|
||||
floatingObject.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
|
||||
floatingObject.container.connectToParent(canvas.floatingSpace.container, false, false, false, false, false, false, false, false)
|
||||
@@ -59,6 +59,22 @@ function newUiObjectConstructor () {
|
||||
}
|
||||
}
|
||||
|
||||
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.isPinned === true) {
|
||||
floatingObject.pinToggle()
|
||||
}
|
||||
if (payload.parentNode.payload.floatingObject.isFrozen === true) {
|
||||
floatingObject.freezeToggle()
|
||||
}
|
||||
if (payload.parentNode.payload.floatingObject.isCollapsed === true) {
|
||||
floatingObject.collapseToggle()
|
||||
}
|
||||
if (payload.parentNode.payload.floatingObject.isTensed === true) {
|
||||
floatingObject.tensionToggle()
|
||||
}
|
||||
}
|
||||
|
||||
let uiObject = newUiObject()
|
||||
payload.uiObject = uiObject
|
||||
uiObject.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
|
||||
|
||||
Reference in new issue
Block a user