Improvements
This commit is contained in:
1 parent
988309ccd1
commit
34570bfac6
4 files changed
+21
-4
No files matched your search
@@ -15,6 +15,7 @@ function newWorkspace() {
|
||||
save: saveWorkspace,
|
||||
backup: backupWorkspace,
|
||||
share: shareWorkspace,
|
||||
getProjectsHeads: getProjectsHeads,
|
||||
getHierarchyHeads: getHierarchyHeads,
|
||||
getHierarchyHeadsById: getHierarchyHeadsById,
|
||||
getHierarchyHeadsByType: getHierarchyHeadsByType,
|
||||
@@ -363,6 +364,20 @@ function newWorkspace() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function getProjectsHeads() {
|
||||
let nodes = []
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
let nodeDefinition = getNodeDefinition(rootNode)
|
||||
if (nodeDefinition !== undefined) {
|
||||
if (nodeDefinition.isProjectHead === true) {
|
||||
nodes.push(rootNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nodes
|
||||
}
|
||||
|
||||
function getHierarchyHeadsById(nodeId) {
|
||||
let hiriatchyHeads = getHierarchyHeads()
|
||||
for (let i = 0; i < hiriatchyHeads.length; i++) {
|
||||
|
||||
@@ -1531,7 +1531,7 @@ function newUiObject() {
|
||||
if (canvas.floatingSpace.inMapMode === true) {
|
||||
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
|
||||
if (nodeDefinition !== undefined) {
|
||||
if (nodeDefinition.isHierarchyHead !== true) {
|
||||
if (nodeDefinition.isHierarchyHead !== true && nodeDefinition.isProjectHead !== true) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -2202,7 +2202,7 @@ function newUiObject() {
|
||||
if (nodeDefinition === undefined) { return }
|
||||
|
||||
if (canvas.floatingSpace.inMapMode === true) {
|
||||
if (nodeDefinition.isHierarchyHead === true) {
|
||||
if (nodeDefinition.isHierarchyHead === true || nodeDefinition.isProjectHead === true ) {
|
||||
totalImageSize = 50
|
||||
} else {
|
||||
totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize)
|
||||
|
||||
@@ -340,7 +340,7 @@ function newUiObjectTitle() {
|
||||
|
||||
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
|
||||
if (nodeDefinition !== undefined) {
|
||||
if (nodeDefinition.isHierarchyHead !== true) {
|
||||
if (nodeDefinition.isHierarchyHead !== true && nodeDefinition.isProjectHead !== true) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,8 +209,10 @@ function newFloatingSpace() {
|
||||
x: mousePosition.x / browserCanvas.width * SPACE_SIZE,
|
||||
y: mousePosition.y / browserCanvas.height * SPACE_SIZE
|
||||
}
|
||||
/* Let's see if we can snap to some of the root nodes that are isHierarchyHead */
|
||||
/* Let's see if we can snap to some of the root nodes that are Hierarchy Head and Project Heads */
|
||||
let snapCandidateNodes = canvas.designSpace.workspace.getHierarchyHeads()
|
||||
snapCandidateNodes = snapCandidateNodes.concat(canvas.designSpace.workspace.getProjectsHeads())
|
||||
|
||||
for (let i = 0; i < snapCandidateNodes.length; i++) {
|
||||
let node = snapCandidateNodes[i]
|
||||
let nodePosition = {
|
||||
|
||||
Reference in new issue
Block a user