From c88b79cff5e91490d15873707c4833679be25475 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 23 Mar 2020 20:56:04 +0100 Subject: [PATCH] improvement no ring --- FloatingSpace/CircularProgressBar.js | 5 +++++ FloatingSpace/UiObject.js | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/FloatingSpace/CircularProgressBar.js b/FloatingSpace/CircularProgressBar.js index 5a9c64d8d..07973d7ee 100644 --- a/FloatingSpace/CircularProgressBar.js +++ b/FloatingSpace/CircularProgressBar.js @@ -25,6 +25,8 @@ function newCircularProgressBar () { let eventSubscriptionIdHeartbeat + let needToDrawRing = true + return thisObject function finalize () { @@ -62,6 +64,7 @@ function newCircularProgressBar () { thisObject.payload.uiObject.setPercentage(message.event.percentage, 2000) } if (message.event.status !== undefined) { + needToDrawRing = false thisObject.payload.uiObject.setStatus(message.event.status, 200000) } @@ -95,6 +98,8 @@ function newCircularProgressBar () { function drawBackground (pFloatingObject) { if (canvas.floatingSpace.inMapMode === true) { return } + if (needToDrawRing !== true) { return } + const VISIBLE_RADIUS = thisObject.container.frame.radius * 2 let visiblePosition = { diff --git a/FloatingSpace/UiObject.js b/FloatingSpace/UiObject.js index 10fbee7f0..96955b532 100644 --- a/FloatingSpace/UiObject.js +++ b/FloatingSpace/UiObject.js @@ -751,7 +751,7 @@ function newUiObject () { thisObject.circularProgressBar.fitFunction = thisObject.fitFunction thisObject.circularProgressBar.container = thisObject.container - /* We will wait to hear the first onHeartBeat in order to confirm the execution was really started */ + /* We will wait to hear the Running event in order to confirm the execution was really started */ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id systemEventHandler.listenToEvent(key, 'Running', undefined, 'UiObject', onResponse, onRunning) @@ -1371,7 +1371,7 @@ function newUiObject () { position = canvas.floatingSpace.transformPointToMap(position) } - let radius = thisObject.container.frame.radius * 1.4 + let radius = thisObject.container.frame.radius * 0.9 /* Label Text */ let labelPoint let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2 @@ -1389,7 +1389,7 @@ 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 + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15 } browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY