This commit is contained in:
Luis Fernando Molina committed 2020-03-15 14:13:36 +01:00
1 parent 22c5197c55
commit 38b443e9e9
2 files changed
+11 -2

No files matched your search

+4
View File
@@ -252,6 +252,10 @@ function newCanvas () {
checkMediaRecording(event)
canvas.chartingSpace.onKeyPressed(event)
if (event.key === 'Escape' && canvas.floatingSpace.inMapMode === true) {
canvas.floatingSpace.exitMapMode()
}
let nodeOnFocus = canvas.designSpace.workspace.getNodeThatIsOnFocus()
if (nodeOnFocus !== undefined) {
if (nodeOnFocus.payload.uiObject.codeEditor !== undefined) {
+7 -2
View File
@@ -12,6 +12,7 @@ function newFloatingSpace () {
uiObjectConstructor: undefined,
container: undefined,
inMapMode: false,
exitMapMode: exitMapMode,
transformPointToMap: transformPointToMap,
transformRadiusToMap: transformRadiusToMap,
transformImagesizeToMap: transformImagesizeToMap,
@@ -108,6 +109,11 @@ function newFloatingSpace () {
thisObject.inMapMode = true
}
function exitMapMode () {
thisObject.inMapMode = false
doubleClickCounter = 0
}
function onDragStarted (event) {
if (thisObject.inMapMode === false) {
if (doubleClickCounter > 0) {
@@ -117,10 +123,9 @@ function newFloatingSpace () {
doubleClickCounter = 10
}
} else {
thisObject.inMapMode = false
doubleClickCounter = 0
thisObject.container.frame.position.x = -event.x / browserCanvas.width * SPACE_SIZE + browserCanvas.width / 2
thisObject.container.frame.position.y = -event.y / browserCanvas.height * SPACE_SIZE + browserCanvas.height / 2
exitMapMode()
}
}