Skip to content
Permalink
Browse files

Don't let other values be less than zero

  • Loading branch information...
geowar1 committed Sep 29, 2018
1 parent 9d7cf1d commit 926dba47e8ee065d1a1630a3e84fc9546e12fdee
Showing with 9 additions and 9 deletions.
  1. +9 −9 java/src/jmri/jmrit/display/layoutEditor/TrackSegment.java
@@ -3275,7 +3275,7 @@ public int getArrowLineWidth() {

public void setArrowLineWidth(int newVal) {
if (arrowLineWidth != newVal) {
arrowLineWidth = Math.max(1, newVal);
arrowLineWidth = Math.max(1, newVal); // don't let value be less than 1
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3383,7 +3383,7 @@ public int getBridgeDeckWidth() {

public void setBridgeDeckWidth(int newVal) {
if (bridgeDeckWidth != newVal) {
bridgeDeckWidth = newVal;
bridgeDeckWidth = Math.max(0, newVal); // don't let value be less than 0
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3396,7 +3396,7 @@ public int getBridgeLineWidth() {

public void setBridgeLineWidth(int newVal) {
if (bridgeLineWidth != newVal) {
bridgeLineWidth = Math.max(1, newVal);
bridgeLineWidth = Math.max(1, newVal); // don't let value be less than 1
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3409,7 +3409,7 @@ public int getBridgeApproachWidth() {

public void setBridgeApproachWidth(int newVal) {
if (bridgeApproachWidth != newVal) {
bridgeApproachWidth = newVal;
bridgeApproachWidth = Math.max(0, newVal); // don't let value be less than 0
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3465,7 +3465,7 @@ public int getBumperLineWidth() {

public void setBumperLineWidth(int newVal) {
if (bumperLineWidth != newVal) {
bumperLineWidth = Math.max(1, newVal);
bumperLineWidth = Math.max(1, newVal); // don't let value be less than 1
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3500,7 +3500,7 @@ public int getBumperLength() {

public void setBumperLength(int newVal) {
if (bumperLength != newVal) {
bumperLength = newVal;
bumperLength = Math.max(0, newVal); // don't let value be less than 0
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3595,7 +3595,7 @@ public int getTunnelFloorWidth() {

public void setTunnelFloorWidth(int newVal) {
if (tunnelFloorWidth != newVal) {
tunnelFloorWidth = newVal;
tunnelFloorWidth = Math.max(0, newVal); // don't let value be less than 0
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3608,7 +3608,7 @@ public int getTunnelLineWidth() {

public void setTunnelLineWidth(int newVal) {
if (tunnelLineWidth != newVal) {
tunnelLineWidth = Math.max(1, newVal);
tunnelLineWidth = Math.max(1, newVal); // don't let value be less than 1
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}
@@ -3621,7 +3621,7 @@ public int getTunnelEntranceWidth() {

public void setTunnelEntranceWidth(int newVal) {
if (tunnelEntranceWidth != newVal) {
tunnelEntranceWidth = newVal;
tunnelEntranceWidth = Math.max(0, newVal); // don't let value be less than 0
layoutEditor.redrawPanel();
layoutEditor.setDirty();
}

0 comments on commit 926dba4

Please sign in to comment.
You can’t perform that action at this time.