not visible panels dont count on positioning physics
This commit is contained in:
1 parent
fda985bc57
commit
6ed3d64519
4 files changed
+43
-10
No files matched your search
@@ -329,10 +329,21 @@ function newTimeMachine () {
|
||||
}
|
||||
|
||||
function physics () {
|
||||
thisObjectPhysics()
|
||||
childrenPhysics()
|
||||
syncWithDesigner()
|
||||
saveFrame(thisObject.payload, thisObject.container.frame)
|
||||
if (thisObject.container.frame.isInViewPort()) {
|
||||
thisObjectPhysics()
|
||||
childrenPhysics()
|
||||
syncWithDesigner()
|
||||
saveFrame(thisObject.payload, thisObject.container.frame)
|
||||
}
|
||||
panelPhysics()
|
||||
}
|
||||
|
||||
function panelPhysics () {
|
||||
if (thisObject.container.frame.isInViewPort()) {
|
||||
canvas.panelsSpace.makeVisible(thisObject.payload.node.id)
|
||||
} else {
|
||||
canvas.panelsSpace.makeInvisible(thisObject.payload.node.id)
|
||||
}
|
||||
}
|
||||
|
||||
function syncWithDesigner () {
|
||||
|
||||
@@ -5,6 +5,7 @@ function newProductsPanel () {
|
||||
container: undefined,
|
||||
layers: [],
|
||||
payload: undefined,
|
||||
isVisible: true,
|
||||
getLoadingLayers: getLoadingLayers,
|
||||
physics: physics,
|
||||
draw: draw,
|
||||
|
||||
@@ -332,11 +332,11 @@ function newChartSpace () {
|
||||
}
|
||||
|
||||
if (timeMachine.container.frame.isInViewPort()) {
|
||||
timeMachine.physics()
|
||||
thisObject.inViewport.set(timeMachine.payload.node.id, timeMachine)
|
||||
} else {
|
||||
thisObject.inViewport.delete(timeMachine.payload.node.id)
|
||||
}
|
||||
timeMachine.physics()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+26
-5
@@ -8,6 +8,8 @@ function newPanelsSpace () {
|
||||
let thisObject = {
|
||||
visible: true,
|
||||
container: undefined,
|
||||
makeVisible: makeVisible,
|
||||
makeInvisible: makeInvisible,
|
||||
createNewPanel: createNewPanel,
|
||||
destroyPanel: destroyPanel,
|
||||
getPanel: getPanel,
|
||||
@@ -73,6 +75,24 @@ function newPanelsSpace () {
|
||||
return panel.handle
|
||||
}
|
||||
|
||||
function makeVisible (owner) {
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
let panel = thisObject.panels[i]
|
||||
if (panel.owner === owner) {
|
||||
panel.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function makeInvisible (owner) {
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
let panel = thisObject.panels[i]
|
||||
if (panel.owner === owner) {
|
||||
panel.isVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function destroyPanel (pPanelHandle) {
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
let panel = thisObject.panels[i]
|
||||
@@ -264,11 +284,12 @@ function newPanelsSpace () {
|
||||
|
||||
for (let i = 0; i < currentIndex; i++) {
|
||||
let panel = thisObject.panels[i]
|
||||
|
||||
if (isThisPointInsideThisFrame(corner1, panel.container.frame) === true) { return true }
|
||||
if (isThisPointInsideThisFrame(corner2, panel.container.frame) === true) { return true }
|
||||
if (isThisPointInsideThisFrame(corner3, panel.container.frame) === true) { return true }
|
||||
if (isThisPointInsideThisFrame(corner4, panel.container.frame) === true) { return true }
|
||||
if (panel.isVisible === true) {
|
||||
if (isThisPointInsideThisFrame(corner1, panel.container.frame) === true) { return true }
|
||||
if (isThisPointInsideThisFrame(corner2, panel.container.frame) === true) { return true }
|
||||
if (isThisPointInsideThisFrame(corner3, panel.container.frame) === true) { return true }
|
||||
if (isThisPointInsideThisFrame(corner4, panel.container.frame) === true) { return true }
|
||||
}
|
||||
}
|
||||
|
||||
function isThisPointInsideThisFrame (point, frame) {
|
||||
|
||||
Reference in new issue
Block a user