low level BUG in Frame fixed
This commit is contained in:
1 parent
e6a462fd72
commit
17c2fb59d0
2 files changed
+53
-20
No files matched your search
@@ -24,8 +24,9 @@ function newCircularMenuItem () {
|
||||
|
||||
thisObject.container = newContainer()
|
||||
thisObject.container.initialize(MODULE_NAME)
|
||||
thisObject.container.isClickeable = false
|
||||
thisObject.container.isClickeable = true
|
||||
thisObject.container.isDraggeable = false
|
||||
thisObject.container.detectMouseOver = true
|
||||
thisObject.container.frame.radius = 0
|
||||
thisObject.container.frame.position.x = 0
|
||||
thisObject.container.frame.position.y = 0
|
||||
@@ -96,18 +97,11 @@ function newCircularMenuItem () {
|
||||
}
|
||||
|
||||
function onMouseClick (event) {
|
||||
|
||||
console.log('Menu item clicked')
|
||||
}
|
||||
|
||||
function drawBackground () {
|
||||
if (thisObject.container.frame.position.x > 0 && thisObject.isDeployed === true && thisObject.currentRadius >= thisObject.targetRadius) {
|
||||
let position = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
|
||||
position = thisObject.container.frame.frameThisPoint(position)
|
||||
|
||||
let params = {
|
||||
cornerRadius: 3,
|
||||
lineWidth: 0.1,
|
||||
@@ -160,4 +154,3 @@ function newCircularMenuItem () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,25 +65,65 @@ function newFrame () {
|
||||
}
|
||||
|
||||
function frameThisPoint (point) {
|
||||
if (thisObject.parentFrame !== undefined) {
|
||||
point = thisObject.parentFrame.frameThisPoint(point)
|
||||
/* We need not to modify the point received, so me make a copy of it. */
|
||||
|
||||
let checkPoint = {
|
||||
x: point.x,
|
||||
y: point.y
|
||||
}
|
||||
|
||||
point.x = point.x + thisObject.position.x
|
||||
point.y = point.y + thisObject.position.y
|
||||
let parentPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
|
||||
return point
|
||||
let returnPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
|
||||
if (thisObject.parentFrame !== undefined) {
|
||||
parentPoint = thisObject.parentFrame.frameThisPoint(checkPoint)
|
||||
|
||||
returnPoint.x = parentPoint.x + thisObject.position.x
|
||||
returnPoint.y = parentPoint.y + thisObject.position.y
|
||||
} else {
|
||||
returnPoint.x = checkPoint.x + thisObject.position.x
|
||||
returnPoint.y = checkPoint.y + thisObject.position.y
|
||||
}
|
||||
|
||||
return returnPoint
|
||||
}
|
||||
|
||||
function unframeThisPoint (point) {
|
||||
if (thisObject.parentFrame !== undefined) {
|
||||
point = thisObject.parentFrame.unframeThisPoint(point)
|
||||
/* We need not to modify the point received, so me make a copy of it. */
|
||||
|
||||
let checkPoint = {
|
||||
x: point.x,
|
||||
y: point.y
|
||||
}
|
||||
|
||||
point.x = point.x - thisObject.position.x
|
||||
point.y = point.y - thisObject.position.y
|
||||
let parentPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
|
||||
return point
|
||||
let returnPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
|
||||
if (thisObject.parentFrame !== undefined) {
|
||||
parentPoint = thisObject.parentFrame.unframeThisPoint(checkPoint)
|
||||
|
||||
returnPoint.x = parentPoint.x - thisObject.position.x
|
||||
returnPoint.y = parentPoint.y - thisObject.position.y
|
||||
} else {
|
||||
returnPoint.x = checkPoint.x - thisObject.position.x
|
||||
returnPoint.y = checkPoint.y - thisObject.position.y
|
||||
}
|
||||
|
||||
return returnPoint
|
||||
}
|
||||
|
||||
function canYouMoveHere (tempDisplacement) {
|
||||
|
||||
Reference in new issue
Block a user