mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 23:36:27 -04:00
fixes us xor symbol. closes #185
This commit is contained in:
parent
d043281167
commit
fc03f692df
@ -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
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user