mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 22:41:59 -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
|
||||
*
|
||||
* @author hneemann
|
||||
*/
|
||||
public class ConstShape implements Shape {
|
||||
@ -31,7 +32,9 @@ public class ConstShape implements Shape {
|
||||
*/
|
||||
public ConstShape(ElementAttributes attr, PinDescriptions inputs, PinDescriptions 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user