From f3e39276775e81c88647b2ef2f31444a3443aa1f Mon Sep 17 00:00:00 2001 From: hneemann Date: Thu, 2 Apr 2020 09:09:45 +0200 Subject: [PATCH] Improved the label text position in the layout shape to match the other components; see #432 --- .../de/neemann/digital/draw/shapes/LayoutShape.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java b/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java index 996fc6d96..d1e7dd9e6 100644 --- a/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java +++ b/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java @@ -145,12 +145,12 @@ public class LayoutShape implements Shape { graphic.drawPolygon(poly, Style.NORMAL.deriveFillStyle(color)); graphic.drawPolygon(poly, Style.NORMAL); - if (top.size() == 0) - graphic.drawText(new Vector(width * SIZE / 2, -4), name, Orientation.CENTERBOTTOM, Style.NORMAL); - else if (bottom.size() == 0) - graphic.drawText(new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.NORMAL); + if (bottom.size() == 0) + graphic.drawText(new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.SHAPE_PIN); + else if (top.size() == 0) + graphic.drawText(new Vector(width * SIZE / 2, -4), name, Orientation.CENTERBOTTOM, Style.SHAPE_PIN); else - graphic.drawText(new Vector(width * SIZE / 2, height * SIZE / 2), name, Orientation.CENTERCENTER, Style.NORMAL); + graphic.drawText(new Vector(width * SIZE / 2, height * SIZE / 2), name, Orientation.CENTERCENTER, Style.SHAPE_PIN); for (PinPos p : left) graphic.drawText(p.pos.add(4, 0), p.label, Orientation.LEFTCENTER, Style.SHAPE_PIN);