summaryrefslogtreecommitdiff
path: root/transform.cc
diff options
context:
space:
mode:
Diffstat (limited to 'transform.cc')
-rw-r--r--transform.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/transform.cc b/transform.cc
index 7ebce98..5951a70 100644
--- a/transform.cc
+++ b/transform.cc
@@ -100,9 +100,11 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const QVector<QStrin
}
if (val_v.type == Value::VECTOR) {
- x = val_v.x; y = val_v.y; z = val_v.z;
- double sn = 1.0 / sqrt(x*x + y*y + z*z);
- x *= sn; y *= sn; z *= sn;
+ if (val_v.x != 0.0 || val_v.y != 0.0 || val_v.z != 0.0) {
+ x = val_v.x; y = val_v.y; z = val_v.z;
+ double sn = 1.0 / sqrt(x*x + y*y + z*z);
+ x *= sn; y *= sn; z *= sn;
+ }
}
double c = cos(a*M_PI/180.0);
contact: Jan Huwald // Impressum