mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-13 14:56:29 -04:00
reverted modification at the generic shape
This commit is contained in:
parent
c40cddd32c
commit
be2d228cb3
@ -206,15 +206,9 @@ public class GenericShape implements Shape {
|
||||
|
||||
if (symmetric && inputs.size() > 0 && ((inputs.size() & 1) == 0)) yBottom += SIZE;
|
||||
|
||||
int top = topBottomBorder;
|
||||
if (outputs.size() > 1) {
|
||||
top += 3;
|
||||
yBottom += 3;
|
||||
}
|
||||
|
||||
Polygon polygon = new Polygon(true)
|
||||
.add(1, -top)
|
||||
.add(SIZE * width - 1, -top)
|
||||
.add(1, -topBottomBorder)
|
||||
.add(SIZE * width - 1, -topBottomBorder)
|
||||
.add(SIZE * width - 1, yBottom)
|
||||
.add(1, yBottom);
|
||||
|
||||
@ -231,7 +225,7 @@ public class GenericShape implements Shape {
|
||||
}
|
||||
|
||||
if (label != null) {
|
||||
Vector pos = new Vector(SIZE2 * width, -top - 8);
|
||||
Vector pos = new Vector(SIZE2 * width, -topBottomBorder - 8);
|
||||
graphic.drawText(pos, pos.add(1, 0), label, Orientation.CENTERBOTTOM, Style.NORMAL);
|
||||
}
|
||||
|
||||
@ -256,7 +250,7 @@ public class GenericShape implements Shape {
|
||||
}
|
||||
if (name.length() > 0) {
|
||||
if (name.length() <= 3 && !showPinLabels) {
|
||||
Vector pos = new Vector(SIZE2 * width, -top + 4);
|
||||
Vector pos = new Vector(SIZE2 * width, -topBottomBorder + 4);
|
||||
graphic.drawText(pos, pos.add(1, 0), name, Orientation.CENTERTOP, Style.NORMAL);
|
||||
} else {
|
||||
Vector pos = new Vector(SIZE2 * width, yBottom + 4);
|
||||
|
@ -19,6 +19,7 @@ import de.neemann.digital.core.switching.*;
|
||||
import de.neemann.digital.core.wiring.*;
|
||||
import de.neemann.digital.draw.elements.PinException;
|
||||
import de.neemann.digital.draw.elements.Tunnel;
|
||||
import de.neemann.digital.draw.graphics.Style;
|
||||
import de.neemann.digital.draw.library.ElementLibrary;
|
||||
import de.neemann.digital.draw.library.ElementTypeDescriptionCustom;
|
||||
import de.neemann.digital.draw.library.JarComponentManager;
|
||||
@ -34,6 +35,9 @@ import de.neemann.digital.testing.TestCaseElement;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static de.neemann.digital.draw.shapes.GenericShape.SIZE;
|
||||
import static de.neemann.digital.draw.shapes.GenericShape.SIZE2;
|
||||
|
||||
/**
|
||||
* Used to create a shape matching a given name
|
||||
*/
|
||||
@ -79,7 +83,7 @@ public final class ShapeFactory {
|
||||
(attributes, inputs, outputs) -> {
|
||||
final boolean ws = attributes.get(Keys.WIDE_SHAPE);
|
||||
return new GenericShape(ws ? "1" : "", inputs, outputs)
|
||||
.setTopBottomBorder(ws ? GenericShape.SIZE : GenericShape.SIZE2)
|
||||
.setTopBottomBorder(ws ? SIZE : SIZE2)
|
||||
.invert(true)
|
||||
.setWide(ws);
|
||||
});
|
||||
@ -224,6 +228,7 @@ public final class ShapeFactory {
|
||||
elementAttributes.getLabel(),
|
||||
true,
|
||||
customDescr.getAttributes().get(Keys.WIDTH))
|
||||
.setTopBottomBorder(SIZE2 + Style.MAXLINETHICK)
|
||||
.setColor(customDescr.getAttributes().get(Keys.BACKGROUND_COLOR));
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user