Skip to content

Commit 4179d35

Browse files
committed
make sure to check for the affine instead of creating it
1 parent f6d3ef6 commit 4179d35

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/main/java/eu/mihosoft/vrl/v3d/CSG.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public MeshView newMesh() {
339339
PhongMaterial m = new PhongMaterial(getColor());
340340
current.setMaterial(m);
341341

342-
boolean hasManipulator = getManipulator() != null;
342+
boolean hasManipulator = hasManipulator();
343343
boolean hasAssembly = getAssemblyStorage().getValue("AssembleAffine") != Optional.empty();
344344

345345
if (hasManipulator || hasAssembly)
@@ -3138,9 +3138,11 @@ public CSG regenerate() {
31383138
if (regenerate == null)
31393139
return this;
31403140
CSG regenerate2 = regenerate.get(getUniqueId()).regenerate(this);
3141-
if (regenerate2 != null)
3142-
return regenerate2.setManipulator(this.getManipulator()).historySync(this);
3143-
;
3141+
if (regenerate2 != null) {
3142+
if(hasManipulator())
3143+
regenerate2.setManipulator(this.getManipulator());
3144+
return regenerate2.historySync(this);
3145+
}
31443146
return this;
31453147
}
31463148

src/main/java/eu/mihosoft/vrl/v3d/parametrics/CSGDatabaseInstance.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ public Set<String> getParameters(CSG instance) {
9999
public CSGDatabaseInstance setParameterNewValue(CSG instance, String key, double newValue) {
100100
IParametric function = getMapOfparametrics(instance).get(key);
101101
if (function != null) {
102-
CSG setManipulator = function.change(instance, key, new Long((long) (newValue * 1000)))
103-
.setManipulator(instance.getManipulator());
102+
CSG setManipulator = function.change(instance, key, new Long((long) (newValue * 1000)));
103+
if(setManipulator.hasManipulator())
104+
setManipulator.setManipulator(instance.getManipulator());
104105
setManipulator.setColor(instance.getColor());
105106
return this;
106107
}

src/main/java/eu/mihosoft/vrl/v3d/thumbnail/ThumbnailImage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static Bounds getSellectedBounds(List<CSG> incoming) {
7070
public static WritableImage get(List<CSG> c,CSGDatabaseInstance instance) {
7171
ArrayList<CSG> csgList = new ArrayList<CSG>();
7272
for (CSG cs : c) {
73-
if (cs.getManipulator() != null) {
73+
if (cs.hasManipulator()) {
7474
csgList.add(cs.transformed(TransformConverter.fromAffine(cs.getManipulator())).syncProperties(instance,cs));
7575
} else
7676
csgList.add(cs);

0 commit comments

Comments
 (0)