ZOOM_OUT_THRESHOLD

This commit is contained in:
Luis Fernando Molina committed 2020-02-09 18:38:36 +01:00
1 parent 84e00a9cec
commit a42bbb25c6
3 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -391,7 +391,7 @@ function newTimeMachine () {
}
function panelPhysics () {
if (thisObject.container.frame.isInViewPort() && canvas.chartSpace.viewport.zoomTargetLevel > ZOOM_OUT_THRESHOLD) {
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')
} else {
+3 -1
View File
@@ -41,7 +41,9 @@ UI_FONT = {
SECONDARY: "Source Code Pro"
};
const ZOOM_OUT_THRESHOLD = 10 // This regulates some behavious changes that happens when the user zoom out below this level.
const ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS = 10 // This regulates some behavious changes that happens when the user zoom out below this level.
const ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME = 5 // This help regulate when to change the Time Frame base on the level of zoom out.
let FONT_ASPECT_RATIO = 0.32;
+2 -2
View File
@@ -123,13 +123,13 @@ function newTimeFrameScale () {
}
function zoomOutPhysics () {
if (thisObject.isVisible === true && previousIsVisible === false) {
if ((thisObject.isVisible === true && previousIsVisible === false) && (canvas.chartSpace.viewport.zoomTargetLevel >= ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME)) {
let event = {}
event.timeFrame = thisObject.timeFrame
thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
previousIsVisible = true
}
if (thisObject.isVisible === false && previousIsVisible === true) {
if ((thisObject.isVisible === false && previousIsVisible === true) || (canvas.chartSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME)) {
let event = {}
event.timeFrame = ONE_DAY_IN_MILISECONDS
thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)