Panels hidding

This commit is contained in:
Luis Fernando Molina committed 2020-02-09 20:23:05 +01:00
1 parent a3a4313811
commit b8312eab46
3 files changed
+41 -14

No files matched your search

+30 -4
View File
@@ -392,11 +392,11 @@ function newTimeMachine () {
function panelPhysics () {
if (thisObject.container.frame.isInViewPort() && canvas.chartSpace.viewport.zoomTargetLevel > ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS) {
canvas.panelsSpace.makeVisible(thisObject.payload.node.id, 'Layers Panel')
canvas.panelsSpace.makeVisible(thisObject.payload.node.id, 'Plotter Panel')
canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Layers Panel')
canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Plotter Panel')
} else {
canvas.panelsSpace.makeInvisible(thisObject.payload.node.id, 'Layers Panel')
canvas.panelsSpace.makeInvisible(thisObject.payload.node.id, 'Plotter Panel')
canvas.panelsSpace.hide(thisObject.payload.node.id, 'Layers Panel')
canvas.panelsSpace.hide(thisObject.payload.node.id, 'Plotter Panel')
}
}
@@ -578,6 +578,32 @@ function newTimeMachine () {
lineDash: [1, 3]
}
thisObject.container.frame.draw(false, true, false, thisObject.fitFunction, style)
drawLabel()
}
}
function drawLabel () {
/* Draw Title Above the Container */
let position = {
x: 0,
y: 0
}
let imageSize = 25
let fontSize = 25
let opacity = 1
let icon = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)
position = transformThisPoint(position, thisObject.container)
printLabel(thisObject.payload.node.name, position.x + 30, position.y - 10, opacity, fontSize)
if (icon !== undefined) {
if (icon.canDrawIcon === true) {
browserCanvasContext.drawImage(
icon, position.x - 0,
position.y - 30,
imageSize,
imageSize)
}
}
}
+10 -10
View File
@@ -8,8 +8,8 @@ function newPanelsSpace () {
let thisObject = {
visible: true,
container: undefined,
makeVisible: makeVisible,
makeInvisible: makeInvisible,
unHide: unHide,
hide: hide,
createNewPanel: createNewPanel,
destroyPanel: destroyPanel,
getPanel: getPanel,
@@ -76,20 +76,20 @@ function newPanelsSpace () {
return panel.handle
}
function makeVisible (owner, type) {
function unHide (owner, type) {
for (let i = 0; i < thisObject.panels.length; i++) {
let panel = thisObject.panels[i]
if (panel.owner === owner && panel.type === type) {
panel.isVisible = true
panel.isHidden = false
}
}
}
function makeInvisible (owner, type) {
function hide (owner, type) {
for (let i = 0; i < thisObject.panels.length; i++) {
let panel = thisObject.panels[i]
if (panel.owner === owner && panel.type === type) {
panel.isVisible = false
panel.isHidden = true
}
}
}
@@ -144,7 +144,7 @@ function newPanelsSpace () {
if (thisObject.panels !== undefined) {
for (let i = 0; i < thisObject.panels.length; i++) {
let panel = thisObject.panels[i]
if (panel.isVisible === false) { continue }
if (panel.isVisible === false || panel.isHidden === true) { continue }
/* setting the speed of the panel */
if (panel.container.speed === undefined) {
panel.container.speed = {
@@ -246,7 +246,7 @@ function newPanelsSpace () {
for (let i = 0; i < currentIndex; i++) {
let panel = thisObject.panels[i]
if (panel.isVisible === true) {
if (panel.isVisible === true && panel.isHidden === false) {
if (isThisPointInsideThisFrame(corner1, panel.container.frame) === true) {
pushOut(currentContainer, panel.container, panel.gravitatesTowards)
}
@@ -319,7 +319,7 @@ function newPanelsSpace () {
let panel = thisObject.panels[i]
let owner = canvas.chartSpace.inViewport.get(panel.owner)
if (owner !== undefined) {
if (panel.isVisible === true) {
if (panel.isVisible === true && panel.isHidden === false) {
panel.draw()
}
}
@@ -338,7 +338,7 @@ function newPanelsSpace () {
let panel = thisObject.panels[i]
let owner = canvas.chartSpace.inViewport.get(panel.owner)
if (owner !== undefined) {
if (panel.isVisible === true) {
if (panel.isVisible === true && panel.isHidden === false) {
container = panel.getContainer(point)
}
}
@@ -131,6 +131,7 @@ function drawIcon (icon, xFactor, yFactor, xOffset, yOffset, imageSize, containe
}
imagePosition = container.frame.frameThisPoint(imagePosition)
browserCanvasContext.drawImage(
icon, imagePosition.x,
imagePosition.y,