Double zoom in in

This commit is contained in:
Luis Fernando Molina committed 2020-03-16 11:53:12 +01:00
1 parent 4563d41bcf
commit c3f6b94479
3 files changed
+27 -6

No files matched your search

+21
View File
@@ -109,6 +109,11 @@ function newEdgeEditor () {
if (canvas.chartingSpace.viewport.zoomLevel === DOUBLE_CLICK_ZOOM_OUT_LEVEL) {
canvas.chartingSpace.viewport.displaceToContainer(thisObject.container.parentContainer)
canvas.chartingSpace.viewport.zoomAtCenter(DOUBLE_CLICK_ZOOM_IN_LEVEL)
return
}
if (canvas.chartingSpace.viewport.zoomLevel === DOUBLE_CLICK_ZOOM_IN_LEVEL) {
canvas.chartingSpace.viewport.zoomAtCenter(DOUBLE_CLICK_ZOOM_IN_IN_LEVEL)
return
}
}
@@ -476,7 +481,23 @@ function newEdgeEditor () {
}
}
function testDraw () {
let y = (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
browserCanvasContext.beginPath()
browserCanvasContext.moveTo(0, y)
browserCanvasContext.lineTo(2000, y)
browserCanvasContext.moveTo(browserCanvas.width / 2, 0)
browserCanvasContext.lineTo(browserCanvas.width / 2, 2000)
browserCanvasContext.closePath()
browserCanvasContext.lineWidth = 1
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + 1 + ')'
browserCanvasContext.stroke()
}
function drawForeground () {
testDraw()
let MARGIN = 1
let edgeSize
let lineWidth
+4 -5
View File
@@ -137,10 +137,10 @@ function newViewport () {
function displaceToContainer (container) {
let targetPoint = {
x: -container.frame.position.x - container.frame.width / 2,
y: -container.frame.position.y - container.frame.height / 2 + TOP_SPACE_HEIGHT
y: -container.frame.position.y - container.frame.height / 2
}
position.x = targetPoint.x + thisObject.width / 2
position.y = targetPoint.y + thisObject.height / 2
position.x = targetPoint.x + browserCanvas.width / 2
position.y = targetPoint.y + (browserCanvas.height - COCKPIT_SPACE_HEIGHT - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
}
function zoomAtCenter (level) {
@@ -152,7 +152,7 @@ function newViewport () {
function mousePositionPhysics () {
if (overrideMousePositionCounter > 0) {
thisObject.mousePosition.x = browserCanvas.width / 2
thisObject.mousePosition.y = (browserCanvas.height - TOP_SPACE_HEIGHT) / 2 - TOP_SPACE_HEIGHT / 2
thisObject.mousePosition.y = (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
overrideMousePositionCounter--
if (overrideMousePositionCounter < 0) {
@@ -413,4 +413,3 @@ function newViewport () {
}
}
}
+2 -1
View File
@@ -45,7 +45,8 @@ const MAC_AMOUNT_FACTOR = 5
const IS_MAC = navigator.platform.toUpperCase().indexOf('MAC') >= 0
const DOUBLE_CLICK_ZOOM_OUT_LEVEL = 0
const DOUBLE_CLICK_ZOOM_IN_LEVEL = 7
const DOUBLE_CLICK_ZOOM_IN_LEVEL = 6
const DOUBLE_CLICK_ZOOM_IN_IN_LEVEL = 7
const DEBUG = {}
const ZOOM_OUT_THRESHOLD_FOR_NOT_HIDDING_PANELS = 12