From b408ee3868a927edefee2459d2383aa3cc38edad Mon Sep 17 00:00:00 2001
From: Phillipus
Date: Mon, 19 Feb 2024 12:11:09 +0000
Subject: [PATCH] Draw target feedback box with better graphics calculation
- This was clipped on the right side on Mac
---
.../diagram/figures/AbstractContainerFigure.java | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/AbstractContainerFigure.java b/com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/AbstractContainerFigure.java
index 572730a3f..6831b3071 100644
--- a/com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/AbstractContainerFigure.java
+++ b/com.archimatetool.editor/src/com/archimatetool/editor/diagram/figures/AbstractContainerFigure.java
@@ -11,6 +11,7 @@
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.geometry.Translatable;
import org.eclipse.swt.SWT;
@@ -112,19 +113,8 @@ protected void drawTargetFeedback(Graphics graphics) {
}
Rectangle bounds = getBounds().getCopy();
+ bounds.shrink(new Insets(1, 1, 2, 2));
- // Scaling
- double scale = FigureUtils.getFigureScale(this);
- if(scale == 1.5) {
- bounds.width--;
- bounds.height--;
- }
- else if(scale < 1) {
- bounds.width -= 2;
- bounds.height -= 2;
- }
-
- bounds.shrink(1, 1);
graphics.setForegroundColor(ColorConstants.blue);
graphics.setLineWidth(2);
graphics.drawRectangle(bounds);