diff --git a/src/main/java/de/neemann/digital/core/IntFormat.java b/src/main/java/de/neemann/digital/core/IntFormat.java index cfdeed5d0..f5a16f769 100644 --- a/src/main/java/de/neemann/digital/core/IntFormat.java +++ b/src/main/java/de/neemann/digital/core/IntFormat.java @@ -478,6 +478,11 @@ public enum IntFormat { public boolean isSuitedForAddresses() { return false; } + + @Override + public boolean isProportional() { + return false; + } } } diff --git a/src/main/java/de/neemann/digital/core/ValueFormatter.java b/src/main/java/de/neemann/digital/core/ValueFormatter.java index 12a3f9293..2ec904c49 100644 --- a/src/main/java/de/neemann/digital/core/ValueFormatter.java +++ b/src/main/java/de/neemann/digital/core/ValueFormatter.java @@ -44,4 +44,14 @@ public interface ValueFormatter { * @return true if formatter is suited to display addresses */ boolean isSuitedForAddresses(); + + /** + * If the represented value is proportional to the underlying integer value. + * This is not the case at float values. + * + * @return true if represented valueis proportional to the underlying integer value + */ + default boolean isProportional() { + return true; + } } diff --git a/src/main/java/de/neemann/digital/draw/shapes/InputShape.java b/src/main/java/de/neemann/digital/draw/shapes/InputShape.java index af3453c26..bb9fa2a8e 100644 --- a/src/main/java/de/neemann/digital/draw/shapes/InputShape.java +++ b/src/main/java/de/neemann/digital/draw/shapes/InputShape.java @@ -183,7 +183,7 @@ public class InputShape implements Shape { @Override public void dragged(CircuitComponent cc, Point posOnScreen, Vector pos, Transform transform, IOState ioState, Element element, SyncAccess modelSync) { ObservableValue value = ioState.getOutput(0); - if (bits > 1 && !value.isHighZ()) { + if (bits > 1 && !value.isHighZ() && formatter.isProportional()) { if (!isDrag) { isDrag = true; startPos = posOnScreen;