Improvements at the place where it is generated
This commit is contained in:
1 parent
d2953a5b5a
commit
88d029a72b
2 files changed
+12
-6
No files matched your search
@@ -26,9 +26,9 @@ function newStrategyParts () {
|
||||
floatingLayer = pFloatingLayer
|
||||
}
|
||||
|
||||
function createNewStrategyPart (type, pPayload) {
|
||||
function createNewStrategyPart (type, payload) {
|
||||
let floatingObject = newFloatingObject()
|
||||
floatingObject.payload = pPayload
|
||||
floatingObject.payload = payload
|
||||
floatingObject.initialize('Strategy Part', type, floatingLayer)
|
||||
floatingObject.underlayingObject.type = type // after initialize
|
||||
|
||||
|
||||
@@ -38,12 +38,17 @@ function newStrategy () {
|
||||
}
|
||||
|
||||
function createPart (partType, name, node, parentNode, chainParent, title) {
|
||||
let payload = {
|
||||
position: {
|
||||
let payload = {}
|
||||
if (chainParent === undefined) {
|
||||
payload.position = {
|
||||
x: (viewPort.width - SIDE_PANEL_WIDTH) / 2 + SIDE_PANEL_WIDTH,
|
||||
y: viewPort.height / 2
|
||||
},
|
||||
visible: true
|
||||
}
|
||||
} else {
|
||||
payload.position = {
|
||||
x: chainParent.payload.position.x,
|
||||
y: chainParent.payload.position.y
|
||||
}
|
||||
}
|
||||
|
||||
if (title !== undefined) {
|
||||
@@ -52,6 +57,7 @@ function newStrategy () {
|
||||
payload.upLabel = partType
|
||||
}
|
||||
|
||||
payload.visible = true
|
||||
payload.downLabel = name
|
||||
payload.node = node
|
||||
payload.parentNode = parentNode
|
||||
|
||||
Reference in new issue
Block a user