mirror of
https://github.com/hneemann/Digital.git
synced 2025-10-01 17:00:34 -04:00
ConstShape shows only as much bits as necessary.
This commit is contained in:
parent
c705acc033
commit
8b842d3784
@ -15,6 +15,7 @@ import de.neemann.digital.draw.graphics.Vector;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The constant shape
|
* The constant shape
|
||||||
|
*
|
||||||
* @author hneemann
|
* @author hneemann
|
||||||
*/
|
*/
|
||||||
public class ConstShape implements Shape {
|
public class ConstShape implements Shape {
|
||||||
@ -31,7 +32,9 @@ public class ConstShape implements Shape {
|
|||||||
*/
|
*/
|
||||||
public ConstShape(ElementAttributes attr, PinDescriptions inputs, PinDescriptions outputs) {
|
public ConstShape(ElementAttributes attr, PinDescriptions inputs, PinDescriptions outputs) {
|
||||||
this.outputs = outputs;
|
this.outputs = outputs;
|
||||||
this.value = ObservableValue.getHexString(attr.get(Keys.VALUE));
|
int bits = attr.getBits();
|
||||||
|
long mask = (1L << bits) - 1;
|
||||||
|
this.value = ObservableValue.getHexString(attr.get(Keys.VALUE) & mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user