diff --git a/FloatingSpace/CodeEditor.js b/FloatingSpace/CodeEditor.js index 933297c70..d606461f9 100644 --- a/FloatingSpace/CodeEditor.js +++ b/FloatingSpace/CodeEditor.js @@ -167,13 +167,13 @@ function newCodeEditor () { if (radius > 0.5) { browserCanvasContext.beginPath() - browserCanvasContext.arc(position.x, position.y, radius * 1.5 + 3, 0, Math.PI * 2, true) + browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true) browserCanvasContext.closePath() browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')' browserCanvasContext.fill() browserCanvasContext.beginPath() - browserCanvasContext.arc(position.x, position.y, radius * 1.5, 0, Math.PI * 2, true) + browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true) browserCanvasContext.closePath() browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + 1 + ')' browserCanvasContext.fill() diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 2dc24d638..f81e6e3ab 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -377,15 +377,22 @@ function newStrategyPart () { drawConnectingLine() thisObject.menu.drawBackground() - drawText(params) - - drawBodyAndPicture(params) - thisObject.menu.drawForeground() - if (thisObject.codeEditor !== undefined) { thisObject.codeEditor.drawBackground() thisObject.codeEditor.drawForeground() } + + drawText(params) + + if (thisObject.codeEditor !== undefined) { + if (thisObject.codeEditor.visible === false) { + drawBodyAndPicture(params) + thisObject.menu.drawForeground() + } + } else { + drawBodyAndPicture(params) + thisObject.menu.drawForeground() + } } } @@ -446,6 +453,8 @@ function newStrategyPart () { let label if (radius > 6 && thisObject.isOnFocus === true) { + const MAX_LABEL_LENGTH = 25 + browserCanvasContext.strokeStyle = params.labelStrokeStyle browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY @@ -453,8 +462,12 @@ function newStrategyPart () { label = params.payload.downLabel if (label !== undefined) { + if (label.length > MAX_LABEL_LENGTH) { + label = label.substring(0, MAX_LABEL_LENGTH) + '...' + } + labelPoint = { - x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO, + x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO * 1.2, y: position.y - radius * 1 / 2 - fontSize * FONT_ASPECT_RATIO - 10 } @@ -464,9 +477,15 @@ function newStrategyPart () { } } if (radius > 6) { + const MAX_LABEL_LENGTH = 30 + label = params.payload.upLabel if (label !== undefined) { + if (label.length > MAX_LABEL_LENGTH) { + label = label.substring(0, MAX_LABEL_LENGTH) + '...' + } + labelPoint = { x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO, y: position.y + radius * 2 / 3 + fontSize * FONT_ASPECT_RATIO + 15