mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-22 20:01:09 -04:00
fixes an issue with the input shape dragging slider
This commit is contained in:
parent
336a8d283a
commit
42c74f3fcc
@ -478,6 +478,11 @@ public enum IntFormat {
|
||||
public boolean isSuitedForAddresses() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProportional() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user