mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-16 08:25:09 -04:00
minor changes of new layout shape
This commit is contained in:
parent
78726e8b7f
commit
5fe6af4655
@ -97,10 +97,10 @@ public class LayoutShape implements Shape {
|
|||||||
width = Math.max(Math.max(top.size(), bottom.size()) + 1, custom.getAttributes().get(Keys.WIDTH));
|
width = Math.max(Math.max(top.size(), bottom.size()) + 1, custom.getAttributes().get(Keys.WIDTH));
|
||||||
|
|
||||||
HashMap<String, PinPos> map = new HashMap<>();
|
HashMap<String, PinPos> map = new HashMap<>();
|
||||||
top.createPosition(map, new Vector(((width - top.size()) / 2 + 1) * SIZE, 0));
|
top.createPosition(map, new Vector(((width - top.size() - 1) / 2 + 1) * SIZE, 0));
|
||||||
bottom.createPosition(map, new Vector(((width - bottom.size()) / 2 + 1) * SIZE, SIZE * height));
|
bottom.createPosition(map, new Vector(((width - bottom.size() - 1) / 2 + 1) * SIZE, SIZE * height));
|
||||||
left.createPosition(map, new Vector(0, ((height - left.size()) / 2 + 1) * SIZE));
|
left.createPosition(map, new Vector(0, ((height - left.size() - 1) / 2 + 1) * SIZE));
|
||||||
right.createPosition(map, new Vector(SIZE * width, ((height - right.size()) / 2 + 1) * SIZE));
|
right.createPosition(map, new Vector(SIZE * width, ((height - right.size() - 1) / 2 + 1) * SIZE));
|
||||||
|
|
||||||
pins = new Pins();
|
pins = new Pins();
|
||||||
for (PinDescription p : custom.getInputDescription(elementAttributes))
|
for (PinDescription p : custom.getInputDescription(elementAttributes))
|
||||||
@ -150,7 +150,7 @@ public class LayoutShape implements Shape {
|
|||||||
else if (bottom.size() == 0)
|
else if (bottom.size() == 0)
|
||||||
Graphic.drawText(graphic, new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.SHAPE_PIN);
|
Graphic.drawText(graphic, new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.SHAPE_PIN);
|
||||||
else
|
else
|
||||||
Graphic.drawText(graphic, new Vector(width * SIZE / 2, height * SIZE /2), name, Orientation.CENTERCENTER, Style.SHAPE_PIN);
|
Graphic.drawText(graphic, new Vector(width * SIZE / 2, height * SIZE / 2), name, Orientation.CENTERCENTER, Style.SHAPE_PIN);
|
||||||
|
|
||||||
for (PinPos p : left)
|
for (PinPos p : left)
|
||||||
Graphic.drawText(graphic, p.pos.add(4, 0), p.label, Orientation.LEFTCENTER, Style.SHAPE_PIN);
|
Graphic.drawText(graphic, p.pos.add(4, 0), p.label, Orientation.LEFTCENTER, Style.SHAPE_PIN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user