Multiple isTensed Values

This commit is contained in:
Luis Fernando Molina committed 2020-02-04 11:32:15 +01:00
1 parent c737a74168
commit c33cca3166
8 files changed
+44 -21

No files matched your search

@@ -145,7 +145,7 @@ function newNodeCloning () {
isPinned: node.payload.floatingObject.isPinned,
isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
isTensed: (node.payload.floatingObject.isTensed && node.payload.floatingObject.tensedManually)
isTensed: (node.payload.floatingObject.isTensed)
},
uiObject: {
isRunning: node.payload.uiObject.isRunning,
@@ -148,7 +148,7 @@ function newProtocolNode () {
isPinned: node.payload.floatingObject.isPinned,
isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
isTensed: (node.payload.floatingObject.isTensed && node.payload.floatingObject.tensedManually)
isTensed: (node.payload.floatingObject.isTensed)
},
uiObject: {
isRunning: node.payload.uiObject.isRunning,
+1
View File
@@ -83,6 +83,7 @@ function newCircularMenu () {
menuItem.disableIfPropertyIsDefined = menuItemInitialValue.disableIfPropertyIsDefined
menuItem.propertyToCheckFor = menuItemInitialValue.propertyToCheckFor
menuItem.ring = menuItemInitialValue.ring
menuItem.icons = menuItemInitialValue.icons
if (menuItem.label === undefined) {
menuItem.type = 'Icon Only'
+9 -2
View File
@@ -9,6 +9,7 @@ function newCircularMenuItem () {
confirmationLabel: undefined,
iconOn: undefined,
iconOff: undefined,
icons: undefined,
currentIcon: undefined,
disableIfPropertyIsDefined: undefined,
propertyToCheckFor: undefined,
@@ -92,6 +93,7 @@ function newCircularMenuItem () {
thisObject.container = undefined
thisObject.iconOn = undefined
thisObject.iconOff = undefined
thisObject.icons = undefined
thisObject.currentIcon = undefined
thisObject.payload = undefined
thisObject.actionFunction = undefined
@@ -208,8 +210,13 @@ function newCircularMenuItem () {
thisObject.iconOn = canvas.designerSpace.iconByUiObjectType.get(thisObject.relatedUiObject)
thisObject.iconOff = canvas.designerSpace.iconByUiObjectType.get(thisObject.relatedUiObject)
} else {
thisObject.iconOn = canvas.designerSpace.iconCollection.get(thisObject.iconPathOn)
thisObject.iconOff = canvas.designerSpace.iconCollection.get(thisObject.iconPathOff)
if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined) {
thisObject.iconOn = canvas.designerSpace.iconCollection.get(thisObject.iconPathOn)
thisObject.iconOff = canvas.designerSpace.iconCollection.get(thisObject.iconPathOff)
} else {
thisObject.iconOn = canvas.designerSpace.iconCollection.get(thisObject.icons[thisObject.actionStatus()])
thisObject.iconOff = canvas.designerSpace.iconCollection.get(thisObject.icons[thisObject.actionStatus()])
}
}
}
+19 -8
View File
@@ -22,7 +22,7 @@ function newFloatingObject () {
targetRadius: 0, // This is the target radius of the floating object with zoom applied. It should be animated until reaching this value.
isPinned: false,
isFrozen: false,
isTensed: false,
isTensed: TENSION_LEVEL.NO_TENSION,
isCollapsed: false,
isParentCollapsed: false,
frozenManually: false,
@@ -165,13 +165,24 @@ function newFloatingObject () {
}
function tensionToggle () {
if (thisObject.isTensed !== true) {
thisObject.isTensed = true
thisObject.tensedManually = true
} else {
thisObject.isTensed = false
thisObject.tensedManually = false
switch (thisObject.isTensed) {
case TENSION_LEVEL.NO_TENSION:
thisObject.isTensed = TENSION_LEVEL.LEVEL_360
break
case TENSION_LEVEL.LEVEL_360:
thisObject.isTensed = TENSION_LEVEL.LEVEL_180
break
case TENSION_LEVEL.LEVEL_180:
thisObject.isTensed = TENSION_LEVEL.LEVEL_90
break
case TENSION_LEVEL.LEVEL_90:
thisObject.isTensed = TENSION_LEVEL.LEVEL_45
break
case TENSION_LEVEL.LEVEL_45:
thisObject.isTensed = TENSION_LEVEL.NO_TENSION
break
}
return thisObject.isTensed
}
@@ -212,7 +223,7 @@ function newFloatingObject () {
function tensionPhysics () {
/* Tension Effect */
if (thisObject.isTensed === true) {
if (thisObject.isTensed !== TENSION_LEVEL.NO_TENSION) {
let parent = thisObject.payload.chainParent
if (parent === undefined) { return }
if (parent.payload === undefined) { return }
+1 -1
View File
@@ -864,7 +864,7 @@ function newUiObject () {
/* Target Line */
let LINE_STYLE = UI_COLOR.TITANIUM_YELLOW
if (thisObject.payload.floatingObject.isTensed === true) {
if (thisObject.payload.floatingObject.isTensed !== TENSION_LEVEL.NO_TENSION) {
LINE_STYLE = UI_COLOR.GOLDEN_ORANGE
}
if (thisObject.payload.floatingObject.isFrozen === true) {
+4 -8
View File
@@ -57,16 +57,12 @@ function newUiObjectConstructor () {
if (payload.node.savedPayload.floatingObject.isCollapsed === true) {
floatingObject.collapseToggle()
}
if (payload.node.savedPayload.floatingObject.isTensed === true) {
floatingObject.tensionToggle()
}
floatingObject.isTensed = payload.node.savedPayload.floatingObject.isTensed
}
/* For brand new objects being created directly by the user, we will make them inherit some properties from their parents. */
if (userAddingNew === true) {
if (payload.parentNode.payload.floatingObject.isTensed === true) {
floatingObject.tensionToggle()
}
floatingObject.isTensed = payload.parentNode.payload.floatingObject.isTensed
}
let uiObject = newUiObject()
@@ -146,8 +142,7 @@ function newUiObjectConstructor () {
currentStatus: true,
label: undefined,
visible: true,
iconPathOn: 'menu-tensor-fixed-angles',
iconPathOff: 'menu-tensor-free-angles',
icons: ['menu-tensor-free-angles', 'menu-tensor-fixed-angles', 'menu-share', 'compass', 'broken-link'],
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
@@ -315,6 +310,7 @@ function newUiObjectConstructor () {
switch (payload.node.type) {
case 'Workspace': {
level_0()
floatingObject.isTensed = TENSION_LEVEL.LEVEL_360
break
}
+8
View File
@@ -51,6 +51,14 @@ const GET_CONTAINER_PURPOSE = {
DRAGGING: 4
}
const TENSION_LEVEL = {
NO_TENSION: 0,
LEVEL_360: 1,
LEVEL_180: 2,
LEVEL_90: 3,
LEVEL_45: 4
}
/* User Interface Panels */
UI_PANEL = {