trackeditor: fix segment slider negative numbers

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9296 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-02-01 22:45:46 +00:00
parent ea324a0e83
commit 2a2dd16822
2 changed files with 5 additions and 4 deletions

View File

@ -215,7 +215,8 @@ public class SegmentSlider extends JPanel
}
catch (Exception ex)
{
ex.printStackTrace();
// restore the old value
getTextField().setText(nf.format(value));
}
}
}
@ -234,8 +235,8 @@ public class SegmentSlider extends JPanel
{
char c = e.getKeyChar();
// check for valid digit or a single decimal point or a minus when negative number allowed
if (!(Character.isDigit(c) || (min < 0 && c == '-') || (!integerFormat && (c == '.' && !textField.getText().contains(".")))))
// check for valid digit or a single decimal point or a single minus when negative number allowed
if (!(Character.isDigit(c) || (min < 0 && c == '-' && !textField.getText().contains("-")) || (!integerFormat && (c == '.' && !textField.getText().contains(".")))))
{
e.consume();
return;

View File

@ -34,7 +34,7 @@ public class Properties
private static Properties instance = new Properties();
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
public final String title = "sd2-trackeditor";
public final String version = "1.4.23";
public final String version = "1.4.24";
private String path;
private double imageScale = 1;