fixes us xor symbol. closes #185

This commit is contained in:
hneemann 2018-09-13 17:01:39 +02:00
parent d043281167
commit fc03f692df
2 changed files with 7 additions and 1 deletions

View File

@ -42,7 +42,8 @@ public class IEEEOrShape extends IEEEGenericShape {
/** /**
* Creates a new instance * Creates a new instance
* @param inputs inputs *
* @param inputs inputs
* @param outputs outputs * @param outputs outputs
* @param invert true if NOr * @param invert true if NOr
* @param attr the elements attributes * @param attr the elements attributes

View File

@ -45,6 +45,8 @@ public class IEEEXOrShape extends IEEEGenericShape {
new Vector(0, -SIZE2)); new Vector(0, -SIZE2));
} }
private final boolean center;
/** /**
* Creates a new instance * Creates a new instance
* *
@ -55,12 +57,15 @@ public class IEEEXOrShape extends IEEEGenericShape {
*/ */
public IEEEXOrShape(PinDescriptions inputs, PinDescriptions outputs, boolean invert, ElementAttributes attr) { public IEEEXOrShape(PinDescriptions inputs, PinDescriptions outputs, boolean invert, ElementAttributes attr) {
super(inputs, outputs, invert, attr); super(inputs, outputs, invert, attr);
center = (inputs.size() & 1) != 0;
} }
@Override @Override
protected void drawIEEE(Graphic graphic) { protected void drawIEEE(Graphic graphic) {
graphic.drawLine(new Vector(0, 0), new Vector(5 + SIZE2, 0), Style.WIRE); graphic.drawLine(new Vector(0, 0), new Vector(5 + SIZE2, 0), Style.WIRE);
graphic.drawLine(new Vector(0, SIZE * 2), new Vector(5 + SIZE2, SIZE * 2), Style.WIRE); graphic.drawLine(new Vector(0, SIZE * 2), new Vector(5 + SIZE2, SIZE * 2), Style.WIRE);
if (center)
graphic.drawLine(new Vector(0, SIZE), new Vector(7 + SIZE2, SIZE), Style.WIRE);
graphic.drawPolygon(POLYGON, Style.NORMAL); graphic.drawPolygon(POLYGON, Style.NORMAL);
graphic.drawPolygon(POLYGON2, Style.NORMAL); graphic.drawPolygon(POLYGON2, Style.NORMAL);
} }