From 7a0dccf8f979753c337aacebd26f452cc7e65fd5 Mon Sep 17 00:00:00 2001 From: Andras Varga Date: Wed, 27 Mar 2024 16:22:31 +0100 Subject: [PATCH] NetworkNodeCanvasVisualization: leave a whole annotationSpacing (default 4px) space around icon It is hard to justify why there should be half as much space between between the icon and the first annotation, than between two subsequent annotations. In addition, the default 4px/2 = 2px is clearly to small. Before fixing the "+32px for submodule label" bug a few commits ago, gap used to be much larger, but now it's really just 2px. --- .../canvas/scene/NetworkNodeCanvasVisualization.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualization.cc b/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualization.cc index 43df498fcb61..4b379a0b8824 100644 --- a/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualization.cc +++ b/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualization.cc @@ -215,10 +215,10 @@ void NetworkNodeCanvasVisualization::layout() std::vector rcs; // rectangles of annotations already positioned std::vector pts; // candidate points where annotations may be positioned cFigure::Rectangle extendendSubmoduleBounds = submoduleBounds; - extendendSubmoduleBounds.x -= annotationSpacing / 2; - extendendSubmoduleBounds.y -= annotationSpacing / 2; - extendendSubmoduleBounds.width += annotationSpacing; - extendendSubmoduleBounds.height += annotationSpacing; + extendendSubmoduleBounds.x -= annotationSpacing; + extendendSubmoduleBounds.y -= annotationSpacing; + extendendSubmoduleBounds.width += 2 * annotationSpacing; + extendendSubmoduleBounds.height += 2 * annotationSpacing; rcs.push_back(extendendSubmoduleBounds); pts.push_back(getTopLeft(extendendSubmoduleBounds)); pts.push_back(getTopCenter(extendendSubmoduleBounds));