Update CircularMenuItem.js
This commit is contained in:
1 parent
540f18cd69
commit
2905730db6
1 file changed
+16
-2
@@ -39,6 +39,7 @@ function newCircularMenuItem() {
|
||||
container: undefined,
|
||||
payload: undefined,
|
||||
relatedUiObject: undefined,
|
||||
relatedUiObjectProject: undefined,
|
||||
dontShowAtFullscreen: undefined,
|
||||
isEnabled: true,
|
||||
shorcutNumber: undefined,
|
||||
@@ -267,12 +268,22 @@ function newCircularMenuItem() {
|
||||
thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', thisObject.secondaryIcon)
|
||||
thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', thisObject.secondaryIcon)
|
||||
} else {
|
||||
|
||||
/*
|
||||
TODO : This code needs to be cleaned and reorganized. It is not clear how a menu item icon is going to be selected.
|
||||
*/
|
||||
|
||||
if (thisObject.relatedUiObject !== undefined && thisObject.iconProject !== undefined) {
|
||||
thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.iconProject, thisObject.relatedUiObject)
|
||||
thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.iconProject, thisObject.relatedUiObject)
|
||||
} else if (thisObject.relatedUiObject !== undefined && thisObject.iconProject === undefined) {
|
||||
if (thisObject.relatedUiObjectProject !== undefined) {
|
||||
thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.relatedUiObjectProject, thisObject.relatedUiObject)
|
||||
thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.relatedUiObjectProject, thisObject.relatedUiObject)
|
||||
} else {
|
||||
thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.payload.node.project, thisObject.relatedUiObject)
|
||||
thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.payload.node.project, thisObject.relatedUiObject)
|
||||
}
|
||||
} else {
|
||||
if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined && thisObject.iconProject !== undefined) {
|
||||
thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName(thisObject.iconProject, thisObject.iconPathOn)
|
||||
@@ -306,7 +317,7 @@ function newCircularMenuItem() {
|
||||
if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
|
||||
let text = thisObject.action
|
||||
|
||||
if(thisObject.payload.uiObject.payload.referenceParent !== undefined && thisObject.action === 'Reference Detach'){
|
||||
if (thisObject.payload.uiObject.payload.referenceParent !== undefined && thisObject.action === 'Reference Detach') {
|
||||
text = text + ' -> [Existing Reference] Type : [' + thisObject.payload.uiObject.payload.referenceParent.type + '] , Name : [' + thisObject.payload.uiObject.payload.referenceParent.name + ']'
|
||||
}
|
||||
|
||||
@@ -491,8 +502,12 @@ function newCircularMenuItem() {
|
||||
if (thisObject.icon === undefined) {
|
||||
thisObject.icon = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', 'missing-image')
|
||||
}
|
||||
|
||||
if (thisObject.icon !== undefined) {
|
||||
if (thisObject.icon.canDrawIcon === true && thisObject.currentRadius > 1 && thisObject.isDeployed === true) {
|
||||
browserCanvasContext.drawImage(thisObject.icon, menuPosition.x - iconSize, menuPosition.y - iconSize, iconSize * 2, iconSize * 2)
|
||||
}
|
||||
}
|
||||
|
||||
/* Menu Label */
|
||||
if (thisObject.type === 'Icon & Text') {
|
||||
@@ -518,5 +533,4 @@ function newCircularMenuItem() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user