Update UiObject.js
This commit is contained in:
1 parent
457cfed816
commit
ead6abde79
1 file changed
+15
-2
@@ -1245,7 +1245,7 @@ function newUiObject() {
|
||||
}
|
||||
|
||||
function drawMiddleground() {
|
||||
if (thisObject.isOnFocus === false) {
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawErrorMessage()
|
||||
drawWarningMessage()
|
||||
drawInfoMessage()
|
||||
@@ -1660,7 +1660,20 @@ function newUiObject() {
|
||||
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
|
||||
y: position.y
|
||||
}
|
||||
|
||||
/* We will try to put this value according to the angle to the parent node*/
|
||||
if (thisObject.payload !== undefined) {
|
||||
if (thisObject.payload.angle !== undefined) {
|
||||
labelPoint.x = labelPoint.x + radius * 7 / 3 * Math.cos(toRadians(thisObject.payload.angle))
|
||||
labelPoint.y = labelPoint.y + radius * 7 / 3 * Math.sin(toRadians(thisObject.payload.angle))
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
|
||||
Reference in new issue
Block a user