Variants of boards having explicit sizing mode fail when trying to add to a project

This commit is contained in:
Bane Stojkovic
2022-11-20 22:51:55 +01:00
parent 19e9d1692a
commit 50588a759d
7 changed files with 10 additions and 5 deletions
@@ -325,10 +325,11 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
}
public void setLength(Size length) {
if (getMode() == BoardSizingMode.Explicit) {
setControlPoint(firstPoint, 0);
Point2D second = new Point2D.Double(firstPoint.getX() + length.convertToPixels(), firstPoint.getY() + width.convertToPixels());
setControlPoint(second, 1);
if (getMode() == BoardSizingMode.Explicit && length != null && width != null) {
setControlPoint(firstPoint, 0);
Point2D second = new Point2D.Double(firstPoint.getX() + length.convertToPixels(),
firstPoint.getY() + width.convertToPixels());
setControlPoint(second, 1);
}
this.length = length;
}
@@ -343,7 +344,7 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
}
public void setWidth(Size width) {
if (getMode() == BoardSizingMode.Explicit) {
if (getMode() == BoardSizingMode.Explicit && length != null && width != null) {
setControlPoint(firstPoint, 0);
Point2D second = new Point2D.Double(firstPoint.getX() + length.convertToPixels(), firstPoint.getY() + width.convertToPixels());
setControlPoint(second, 1);