Update UiObject.js

This commit is contained in:
Luis Fernando Molina committed 2020-09-02 18:24:53 +02:00
1 parent 457cfed816
commit ead6abde79
1 file changed
+15 -2
+15 -2
View File
@@ -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