From 96fa5c5104e61b20212bc69ac42c63b9e0e48f03 Mon Sep 17 00:00:00 2001 From: iobyte Date: Thu, 18 Jan 2024 20:29:25 +0000 Subject: [PATCH] trackeditor: set height when known git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9261 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 2df171fc51b4f7d18376c823f24654c0f8e1c746 Former-commit-id: 1e5e23e77d6718a480ecd8762136b82f129599cf --- .../gui/segment/SegmentEditorDlg.java | 24 +++++++++++++++---- src/tools/trackeditor/utils/Properties.java | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/tools/trackeditor/gui/segment/SegmentEditorDlg.java b/src/tools/trackeditor/gui/segment/SegmentEditorDlg.java index 990905615..f3222c067 100644 --- a/src/tools/trackeditor/gui/segment/SegmentEditorDlg.java +++ b/src/tools/trackeditor/gui/segment/SegmentEditorDlg.java @@ -959,11 +959,19 @@ public class SegmentEditorDlg extends JDialog implements SliderListener { if (slider.isCheckBoxSelected()) { - if (!Double.isNaN(heightStartLeftSlider.getValue())) + double startLeft = heightStartLeftSlider.getValue(); + double startRight = heightStartRightSlider.getValue(); + + if (!Double.isNaN(startLeft) &&!Double.isNaN(startRight) && startLeft == startRight) + { + heightStartSlider.setValue(startLeft); + } + + if (!Double.isNaN(startLeft)) { heightStartLeftSlider.setValue(Double.NaN); } - if (!Double.isNaN(heightStartRightSlider.getValue())) + if (!Double.isNaN(startRight)) { heightStartRightSlider.setValue(Double.NaN); } @@ -995,11 +1003,19 @@ public class SegmentEditorDlg extends JDialog implements SliderListener { if (slider.isCheckBoxSelected()) { - if (!Double.isNaN(heightEndLeftSlider.getValue())) + double endLeft = heightEndLeftSlider.getValue(); + double endRight = heightEndRightSlider.getValue(); + + if (!Double.isNaN(endLeft) &&!Double.isNaN(endRight) && endLeft == endRight) + { + heightEndSlider.setValue(endLeft); + } + + if (!Double.isNaN(endLeft)) { heightEndLeftSlider.setValue(Double.NaN); } - if (!Double.isNaN(heightEndRightSlider.getValue())) + if (!Double.isNaN(endRight)) { heightEndRightSlider.setValue(Double.NaN); } diff --git a/src/tools/trackeditor/utils/Properties.java b/src/tools/trackeditor/utils/Properties.java index 8cb7132d5..90a7b1bc9 100644 --- a/src/tools/trackeditor/utils/Properties.java +++ b/src/tools/trackeditor/utils/Properties.java @@ -34,7 +34,7 @@ public class Properties private static Properties instance = new Properties(); private Vector propertiesListeners = new Vector(); public final String title = "sd2-trackeditor"; - public final String version = "1.4.7"; + public final String version = "1.4.8"; private String path; private double imageScale = 1;