diff --git a/ChartingSpace/TimeMachine.js b/ChartingSpace/TimeMachine.js index 0d2fdd1db..6e5620fcd 100644 --- a/ChartingSpace/TimeMachine.js +++ b/ChartingSpace/TimeMachine.js @@ -540,24 +540,26 @@ function newTimeMachine () { if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.draw() } } } else { - let icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type) - if (icon !== undefined) { - if (icon.canDrawIcon === true) { - let imageSize = 40 - let imagePosition = { - x: thisObject.container.frame.width / 2, - y: thisObject.container.frame.height / 2 + if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_TIME_MACHINES_ICONIZED) { + let icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type) + if (icon !== undefined) { + if (icon.canDrawIcon === true) { + let imageSize = 40 + let imagePosition = { + x: thisObject.container.frame.width / 2, + y: thisObject.container.frame.height / 2 + } + + imagePosition = transformThisPoint(imagePosition, thisObject.container) + imagePosition = thisObject.fitFunction(imagePosition, true) + + browserCanvasContext.drawImage( + icon, + imagePosition.x - imageSize / 2, + imagePosition.y - imageSize / 2, + imageSize, + imageSize) } - - imagePosition = transformThisPoint(imagePosition, thisObject.container) - imagePosition = thisObject.fitFunction(imagePosition, true) - - browserCanvasContext.drawImage( - icon, - imagePosition.x - imageSize / 2, - imagePosition.y - imageSize / 2, - imageSize, - imageSize) } } } diff --git a/Globals.js b/Globals.js index 161e1c706..375fd8c90 100644 --- a/Globals.js +++ b/Globals.js @@ -46,6 +46,7 @@ const ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS = 5 // This regulates some behavious 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. const ZOOM_OUT_THRESHOLD_FOR_PACKING_OBJECTS_AT_THE_BOTTOM_OR_TOP_OF_VIEWPORT = 2 const ZOOM_OUT_THRESHOLD_FOR_PLOTTING_IN_LOW_RESOLUTION = 3 +const ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_TIME_MACHINES_ICONIZED = 4 let FONT_ASPECT_RATIO = 0.32;