From d59561473a5cf89aed7e1d157987e22d8718fd79 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 15 Jan 2020 22:31:40 +0100 Subject: [PATCH] Bug fixed with header --- Panels/Layer.js | 18 +++++++++--------- Panels/LayersPanel.js | 8 ++++---- Scales/Commons.js | 10 +++++----- Utilities/RoundedCornersBackground.js | 14 +++++++------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Panels/Layer.js b/Panels/Layer.js index 68d2eaffc..eb3d4a805 100644 --- a/Panels/Layer.js +++ b/Panels/Layer.js @@ -452,20 +452,20 @@ function newLayer () { roundedCornersBackground(params) if (label2 !== undefined) { - drawLabel(label1, 1 / 2, 2 / 8, 16, thisObject.container) - drawLabel(label2, 1 / 2, 4 / 8, 16, thisObject.container) + drawLabel(label1, 1 / 2, 2 / 8, 0, 0, 16, thisObject.container) + drawLabel(label2, 1 / 2, 4 / 8, 0, 0, 16, thisObject.container) } else { - drawLabel(label1, 1 / 2, 3 / 8, 20, thisObject.container) + drawLabel(label1, 1 / 2, 3 / 8, 0, 0, 20, thisObject.container) } - drawLabel(label3, 1 / 2, 6 / 8, 10, thisObject.container) - drawLabel(label4, 1 / 2, 7 / 8, 10, thisObject.container) + drawLabel(label3, 1 / 2, 6 / 8, 0, 0, 10, thisObject.container) + drawLabel(label4, 1 / 2, 7 / 8, 0, 0, 10, thisObject.container) /* Images */ - drawIcon(icon1, 1 / 8, 1 / 4, 20, thisObject.container) - drawIcon(icon2, 7 / 8, 1 / 4, 20, thisObject.container) - drawIcon(icon3, 1 / 8, 3 / 4, 20, thisObject.container) - drawIcon(icon4, 7 / 8, 3 / 4, 20, thisObject.container) + drawIcon(icon1, 1 / 8, 1 / 4, 0, 0, 20, thisObject.container) + drawIcon(icon2, 7 / 8, 1 / 4, 0, 0, 20, thisObject.container) + drawIcon(icon3, 1 / 8, 3 / 4, 0, 0, 20, thisObject.container) + drawIcon(icon4, 7 / 8, 3 / 4, 0, 0, 20, thisObject.container) } } diff --git a/Panels/LayersPanel.js b/Panels/LayersPanel.js index 426cefcdb..3c9a82d6c 100644 --- a/Panels/LayersPanel.js +++ b/Panels/LayersPanel.js @@ -325,10 +325,10 @@ function newProductsPanel () { roundedCornersBackground(params) - drawLabel(label1, 1 / 2, 6 / 100, 10, thisObject.container) - drawLabel(label2, 1 / 2, 9 / 100, 10, thisObject.container) + drawLabel(label1, 1 / 2, 0, 0, 20, 10, thisObject.container) + drawLabel(label2, 1 / 2, 0, 0, 40, 10, thisObject.container) - drawIcon(icon1, 1 / 8, 6 / 100, 40, thisObject.container) - drawIcon(icon2, 7 / 8, 6 / 100, 40, thisObject.container) + drawIcon(icon1, 1 / 8, 0, 0, 20, 40, thisObject.container) + drawIcon(icon2, 7 / 8, 0, 0, 40, 40, thisObject.container) } } diff --git a/Scales/Commons.js b/Scales/Commons.js index 476149859..9c6ad4a26 100644 --- a/Scales/Commons.js +++ b/Scales/Commons.js @@ -21,12 +21,12 @@ function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2, label2 = label2.substring(0, 20) label3 = label3.substring(0, 20) - drawLabel(label1, 1 / 2, 4 / 5, 10, container) - drawLabel(label2, 1 / 2, 2 / 5, 20, container) - drawLabel(label3, 1 / 2, 3 / 5, 10, container) + drawLabel(label1, 1 / 2, 4 / 5, 0, 0, 10, container) + drawLabel(label2, 1 / 2, 2 / 5, 0, 0, 20, container) + drawLabel(label3, 1 / 2, 3 / 5, 0, 0, 10, container) - drawIcon(icon1, 1 / 8, 1 / 2, 40, container) - drawIcon(icon2, 7 / 8, 1 / 2, 40, container) + drawIcon(icon1, 1 / 8, 1 / 2, 0, 0, 40, container) + drawIcon(icon2, 7 / 8, 1 / 2, 0, 0, 40, container) } function drawScaleDisplayCover (container) { diff --git a/Utilities/RoundedCornersBackground.js b/Utilities/RoundedCornersBackground.js index 7a2827c62..f534964ca 100644 --- a/Utilities/RoundedCornersBackground.js +++ b/Utilities/RoundedCornersBackground.js @@ -105,13 +105,13 @@ function roundedCornersBackground (params) { browserCanvasContext.stroke() } -function drawLabel (label, xFactor, yFactor, fontSize, container) { +function drawLabel (label, xFactor, yFactor, xOffset, yOffset, fontSize, container) { if (label === undefined) { return } - let xOffset = label.length * fontSize * FONT_ASPECT_RATIO + 10 + let fontOffset = label.length * fontSize * FONT_ASPECT_RATIO + 10 let labelPoint = { - x: container.frame.width * xFactor - xOffset / 2, - y: container.frame.height * yFactor + x: container.frame.width * xFactor + xOffset - fontOffset / 2, + y: container.frame.height * yFactor + yOffset } labelPoint = container.frame.frameThisPoint(labelPoint) @@ -122,12 +122,12 @@ function drawLabel (label, xFactor, yFactor, fontSize, container) { browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y) } -function drawIcon (icon, xFactor, yFactor, imageSize, container) { +function drawIcon (icon, xFactor, yFactor, xOffset, yOffset, imageSize, container) { if (icon !== undefined) { if (icon.canDrawIcon === true) { let imagePosition = { - x: container.frame.width * xFactor - imageSize / 2, - y: container.frame.height * yFactor - imageSize / 2 + x: container.frame.width * xFactor + xOffset - imageSize / 2, + y: container.frame.height * yFactor + yOffset - imageSize / 2 } imagePosition = container.frame.frameThisPoint(imagePosition)