mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-12 14:26:09 -04:00
Improved the label text position in the layout shape to match the other components; see #432
This commit is contained in:
parent
3cdf4ff2e3
commit
f3e3927677
@ -145,12 +145,12 @@ public class LayoutShape implements Shape {
|
|||||||
graphic.drawPolygon(poly, Style.NORMAL.deriveFillStyle(color));
|
graphic.drawPolygon(poly, Style.NORMAL.deriveFillStyle(color));
|
||||||
graphic.drawPolygon(poly, Style.NORMAL);
|
graphic.drawPolygon(poly, Style.NORMAL);
|
||||||
|
|
||||||
if (top.size() == 0)
|
if (bottom.size() == 0)
|
||||||
graphic.drawText(new Vector(width * SIZE / 2, -4), name, Orientation.CENTERBOTTOM, Style.NORMAL);
|
graphic.drawText(new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.SHAPE_PIN);
|
||||||
else if (bottom.size() == 0)
|
else if (top.size() == 0)
|
||||||
graphic.drawText(new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.NORMAL);
|
graphic.drawText(new Vector(width * SIZE / 2, -4), name, Orientation.CENTERBOTTOM, Style.SHAPE_PIN);
|
||||||
else
|
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)
|
for (PinPos p : left)
|
||||||
graphic.drawText(p.pos.add(4, 0), p.label, Orientation.LEFTCENTER, Style.SHAPE_PIN);
|
graphic.drawText(p.pos.add(4, 0), p.label, Orientation.LEFTCENTER, Style.SHAPE_PIN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user