trackeditor: try harder to set height when splitting a segment
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9260 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
parent
8493bbfb38
commit
52268d7063
|
@ -652,14 +652,32 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
|
|||
newShape.getLeft().setBarrierWidth(oldShape.getLeft().getBarrierWidth());
|
||||
newShape.getRight().setBarrierWidth(oldShape.getRight().getBarrierWidth());
|
||||
|
||||
if (!Double.isNaN(oldShape.getHeightStart()) && !Double.isNaN(oldShape.getHeightEnd()))
|
||||
double heightStart = oldShape.getHeightStart();
|
||||
|
||||
if (!Double.isNaN(heightStart) && !Double.isNaN(oldShape.getHeightEnd()))
|
||||
{
|
||||
newShape.setHeightEnd(oldShape.getHeightEnd());
|
||||
double leftHeight = oldShape.getHeightStart() + (oldShape.getHeightEnd() - oldShape.getHeightStart()) * splitPoint;
|
||||
double leftHeight = heightStart + (oldShape.getHeightEnd() - heightStart) * splitPoint;
|
||||
newShape.setHeightStart(leftHeight);
|
||||
oldShape.setHeightEnd(leftHeight);
|
||||
}
|
||||
|
||||
if (!Double.isNaN(heightStart) && !Double.isNaN(oldShape.getHeightEndLeft()))
|
||||
{
|
||||
newShape.setHeightEnd(oldShape.getHeightEndLeft());
|
||||
double leftHeight = heightStart + (oldShape.getHeightEndLeft() - heightStart) * splitPoint;
|
||||
newShape.setHeightStartLeft(leftHeight);
|
||||
oldShape.setHeightEndLeft(leftHeight);
|
||||
}
|
||||
|
||||
if (!Double.isNaN(heightStart) && !Double.isNaN(oldShape.getHeightEndRight()))
|
||||
{
|
||||
newShape.setHeightEnd(oldShape.getHeightEndRight());
|
||||
double leftHeight = heightStart + (oldShape.getHeightEndRight() - heightStart) * splitPoint;
|
||||
newShape.setHeightStartRight(leftHeight);
|
||||
oldShape.setHeightEndRight(leftHeight);
|
||||
}
|
||||
|
||||
if (!Double.isNaN(oldShape.getHeightStartLeft()) && !Double.isNaN(oldShape.getHeightEndLeft()))
|
||||
{
|
||||
newShape.setHeightEndLeft(oldShape.getHeightEndLeft());
|
||||
|
@ -668,6 +686,14 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
|
|||
oldShape.setHeightEndLeft(leftHeight);
|
||||
}
|
||||
|
||||
if (!Double.isNaN(oldShape.getHeightStartLeft()) && !Double.isNaN(oldShape.getHeightEnd()))
|
||||
{
|
||||
newShape.setHeightEnd(oldShape.getHeightEnd());
|
||||
double leftHeight = oldShape.getHeightStartLeft() + (oldShape.getHeightEnd() - oldShape.getHeightStartLeft()) * splitPoint;
|
||||
newShape.setHeightStartLeft(leftHeight);
|
||||
oldShape.setHeightEndLeft(leftHeight);
|
||||
}
|
||||
|
||||
if (!Double.isNaN(oldShape.getHeightStartRight()) && !Double.isNaN(oldShape.getHeightEndRight()))
|
||||
{
|
||||
newShape.setHeightEndRight(oldShape.getHeightEndRight());
|
||||
|
@ -676,6 +702,14 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
|
|||
oldShape.setHeightEndRight(rightHeight);
|
||||
}
|
||||
|
||||
if (!Double.isNaN(oldShape.getHeightStartRight()) && !Double.isNaN(oldShape.getHeightEnd()))
|
||||
{
|
||||
newShape.setHeightEnd(oldShape.getHeightEnd());
|
||||
double rightHeight = oldShape.getHeightStartRight() + (oldShape.getHeightEnd() - oldShape.getHeightStartRight()) * splitPoint;
|
||||
newShape.setHeightStartRight(rightHeight);
|
||||
oldShape.setHeightEndRight(rightHeight);
|
||||
}
|
||||
|
||||
double bankingStart = getBankingStart(oldShape);
|
||||
|
||||
if (!Double.isNaN(bankingStart) && !Double.isNaN(oldShape.getBankingEnd()))
|
||||
|
|
|
@ -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.6";
|
||||
public final String version = "1.4.7";
|
||||
private String path;
|
||||
|
||||
private double imageScale = 1;
|
||||
|
|
Loading…
Reference in New Issue