From 24e810e9f8c87bef239ae668a2435c79e4197c8f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Dec 2021 12:29:24 -0800 Subject: [PATCH] Fix alignment and test --- packages/mindplot/src/components/Topic.js | 5 +++-- .../mindplot/test/playground/map-render/html/viewmode.html | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/mindplot/src/components/Topic.js b/packages/mindplot/src/components/Topic.js index fbabd451..aa7e9691 100644 --- a/packages/mindplot/src/components/Topic.js +++ b/packages/mindplot/src/components/Topic.js @@ -1286,8 +1286,9 @@ class Topic extends NodeGraph { }); // Adjust all topic elements positions ... - iconGroup.setPosition(padding, (topicHeight - iconHeight) / 2); - textShape.setPosition(padding + iconGroupWith + textIconSpacing, (topicHeight - textHeight) / 2); + const yPosition = Math.round((topicHeight - textHeight) / 2); + iconGroup.setPosition(padding, yPosition); + textShape.setPosition(padding + iconGroupWith + textIconSpacing, yPosition); } else { // In case of images, the size is fixed ... const size = this.getModel().getImageSize(); diff --git a/packages/mindplot/test/playground/map-render/html/viewmode.html b/packages/mindplot/test/playground/map-render/html/viewmode.html index 76469067..c9ca7192 100644 --- a/packages/mindplot/test/playground/map-render/html/viewmode.html +++ b/packages/mindplot/test/playground/map-render/html/viewmode.html @@ -27,9 +27,10 @@ - + - + +