From a32105e156e49eeddea97ef68acd01f8c53909a6 Mon Sep 17 00:00:00 2001 From: bancika Date: Wed, 21 Dec 2016 17:16:49 +0100 Subject: [PATCH] backward compatible fix --- .../src/org/diylc/components/tube/AbstractTubeSymbol.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/diylc/diylc-library/src/org/diylc/components/tube/AbstractTubeSymbol.java b/diylc/diylc-library/src/org/diylc/components/tube/AbstractTubeSymbol.java index 5b6bbdd9..1c6eb60f 100644 --- a/diylc/diylc-library/src/org/diylc/components/tube/AbstractTubeSymbol.java +++ b/diylc/diylc-library/src/org/diylc/components/tube/AbstractTubeSymbol.java @@ -160,6 +160,9 @@ public abstract class AbstractTubeSymbol extends AbstractComponent { @EditableProperty public Orientation getOrientation() { + if (orientation == null) + orientation = Orientation.DEFAULT; + return orientation; } @@ -175,11 +178,11 @@ public abstract class AbstractTubeSymbol extends AbstractComponent { body = null; getBody(); - if (this.orientation == Orientation.DEFAULT) + if (getOrientation() == Orientation.DEFAULT) return; Point first = this.controlPoints[0]; - double angle = Double.parseDouble(this.orientation.name().replace("_", "")); + double angle = Double.parseDouble(getOrientation().name().replace("_", "")); AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.x, first.y); for (int i = 1; i < this.controlPoints.length; i++) { rotate.transform(this.controlPoints[i], this.controlPoints[i]);