Floating Space Settings

This commit is contained in:
Luis Fernando Molina committed 2021-07-04 19:01:58 +02:00
1 parent e7c22b1311
commit 827dcbaee6
3 files changed
+34 -5

No files matched your search

+2 -1
View File
@@ -3,7 +3,8 @@ function newFoundationsGlobalsShorcuts() {
TOGGLE_MAP_MODE: 'M',
TOGGLE_DRAW_REFERENCE_LINES: 'R',
TOGGLE_DRAW_PARENT_LINES: 'C',
SAVE_WORKSPACE: 'S'
SAVE_WORKSPACE: 'S',
ADJUST_ASPECT_RATIO: 'A'
}
return thisObject
}
@@ -186,9 +186,9 @@ function newEdgeEditor() {
function onKeyPressed(event, forceExecution) {
if (forceExecution !== true) {
if (whereIsMouseOver !== 'center' ) {return}
if (whereIsMouseOver !== 'center') { return }
}
const STEP = 10
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') {
@@ -228,7 +228,11 @@ function newEdgeEditor() {
return
}
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'A' || event.key === 'a')) {
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.globals.shorcuts.ADJUST_ASPECT_RATIO || event.key === UI.projects.foundations.globals.shorcuts.ADJUST_ASPECT_RATIO.toLowerCase())
) {
resetAspectRatio()
return
}
@@ -100,7 +100,14 @@ function newFoundationsFloatingSpace() {
}
},
physics: true,
detachUsingMouse: false
detachUsingMouse: false,
shortcuts: {
toggleMapMode: "M",
toggleDrawRelationshipLines: "R",
toggleDrawParentLines: "C",
saveWorkspace: "S",
adjustAspectRatio: "A"
}
}
return thisObject
@@ -540,6 +547,23 @@ function newFoundationsFloatingSpace() {
if (configSettings.detachUsingMouse !== undefined) {
thisObject.settings.detachUsingMouse = configSettings.detachUsingMouse
}
if (configSettings.shortcuts !== undefined) {
if (configSettings.shortcuts.toggleMapMode !== undefined) {
thisObject.settings.shortcuts.toggleMapMode = configSettings.shortcuts.toggleMapMode
}
if (configSettings.shortcuts.toggleDrawRelationshipLines !== undefined) {
thisObject.settings.shortcuts.toggleDrawRelationshipLines = configSettings.shortcuts.toggleDrawRelationshipLines
}
if (configSettings.shortcuts.toggleDrawParentLines !== undefined) {
thisObject.settings.shortcuts.toggleDrawParentLines = configSettings.shortcuts.toggleDrawParentLines
}
if (configSettings.shortcuts.saveWorkspace !== undefined) {
thisObject.settings.shortcuts.saveWorkspace = configSettings.shortcuts.saveWorkspace
}
if (configSettings.shortcuts.adjustAspectRatio !== undefined) {
thisObject.settings.shortcuts.adjustAspectRatio = configSettings.shortcuts.adjustAspectRatio
}
}
}
function positionContraintsPhysics() {