mirror of https://github.com/rusefi/RomRaider.git
Fix bug in setBinValue when the value isn't a float.
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@96 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
4b4c773944
commit
7685df0ee2
|
@ -85,20 +85,19 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
}
|
||||
|
||||
public void setBinValue(double binValue) {
|
||||
this.binValue = binValue;
|
||||
|
||||
// make sure it's in range
|
||||
if (table.getStorageType() != Table.STORAGE_TYPE_FLOAT) {
|
||||
if (binValue < 0) {
|
||||
this.setBinValue(0);
|
||||
} else if (binValue > Math.pow(256, table.getStorageType()) - 1) {
|
||||
this.setBinValue((int)(Math.pow(256, table.getStorageType()) - 1));
|
||||
}
|
||||
binValue = Math.round(binValue);
|
||||
}
|
||||
|
||||
this.updateDisplayValue();
|
||||
}
|
||||
// make sure it's in range
|
||||
if (table.getStorageType() != Table.STORAGE_TYPE_FLOAT) {
|
||||
if (binValue < 0) {
|
||||
this.setBinValue(0);
|
||||
} else if (binValue > Math.pow(256, table.getStorageType()) - 1) {
|
||||
this.setBinValue((int)(Math.pow(256, table.getStorageType()) - 1));
|
||||
}
|
||||
binValue = Math.round(binValue);
|
||||
}
|
||||
|
||||
this.binValue = binValue;
|
||||
this.updateDisplayValue();
|
||||
}
|
||||
|
||||
public double getBinValue() {
|
||||
return binValue;
|
||||
|
|
Loading…
Reference in New Issue