trackeditor: fix segment arc and radius slider updating

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9242 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-01-11 01:56:31 +00:00
parent 91e6cf280a
commit 2be6983966
3 changed files with 18 additions and 7 deletions

View File

@ -332,7 +332,7 @@ public class SegmentEditorDlg extends JDialog implements SliderListener
{
if (radiusStartSlider == null)
{
radiusStartSlider = new SegmentSlider(1, 1000, 1);
radiusStartSlider = new SegmentSlider(1, 1000, 0.001);
radiusStartSlider.setBounds(115, 64, 50, 390);
radiusStartSlider.setSection("Radius");
radiusStartSlider.setAttr("Start");
@ -353,7 +353,7 @@ public class SegmentEditorDlg extends JDialog implements SliderListener
{
if (radiusEndSlider == null)
{
radiusEndSlider = new SegmentSlider(1, 1000, 1);
radiusEndSlider = new SegmentSlider(1, 1000, 0.001);
radiusEndSlider.setBounds(170, 64, 50, 390);
radiusEndSlider.setSection("Radius");
radiusEndSlider.setAttr("End");
@ -374,7 +374,7 @@ public class SegmentEditorDlg extends JDialog implements SliderListener
{
if (arcSlider == null)
{
arcSlider = new SegmentSlider(1, 360, 1);
arcSlider = new SegmentSlider(1, 360, 0.001);
arcSlider.setBounds(60, 64, 50, 390);
arcSlider.setSection("Arc");
arcSlider.setAttr("");

View File

@ -154,8 +154,17 @@ public class SegmentSlider extends JPanel
{
public void changedUpdate(DocumentEvent e)
{
textChanged(e);
}
public void insertUpdate(DocumentEvent e)
{
textChanged(e);
}
public void removeUpdate(DocumentEvent e)
{
textChanged(e);
}
private void textChanged(DocumentEvent e)
{
Runnable doHighlight = new Runnable()
{
@ -170,8 +179,13 @@ public class SegmentSlider extends JPanel
{
try
{
double oldValue = value;
double tmp = Double.parseDouble(getTextField().getText());
setValueInternal(tmp);
if (Math.abs(oldValue - value) >= resolution)
{
valueChanged();
}
}
catch (Exception ex)
{
@ -187,9 +201,6 @@ public class SegmentSlider extends JPanel
};
SwingUtilities.invokeLater(doHighlight);
}
public void removeUpdate(DocumentEvent e)
{
}
});
textField.addKeyListener(new KeyAdapter()
{

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.3.33";
public final String version = "1.3.34";
private String path;
private double imageScale = 1;