diff options
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-x | js/helper-classes/3D/draw-utils.js | 10 | ||||
-rwxr-xr-x | js/helper-classes/3D/math-utils.js | 5 |
2 files changed, 14 insertions, 1 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 02d946ae..59da411f 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js | |||
@@ -112,6 +112,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
112 | this.eventManager.addEventListener("elementDeleted", this, false); | 112 | this.eventManager.addEventListener("elementDeleted", this, false); |
113 | this.eventManager.addEventListener("deleteSelection", this, false); | 113 | this.eventManager.addEventListener("deleteSelection", this, false); |
114 | this.eventManager.addEventListener("elementChange", this, false); | 114 | this.eventManager.addEventListener("elementChange", this, false); |
115 | this.eventManager.addEventListener("closeDocument", this, false); | ||
115 | } | 116 | } |
116 | }, | 117 | }, |
117 | 118 | ||
@@ -135,6 +136,15 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
135 | } | 136 | } |
136 | }, | 137 | }, |
137 | 138 | ||
139 | handleCloseDocument:{ | ||
140 | value: function() { | ||
141 | if(this.application.ninja.documentController._documents.length === 0){ | ||
142 | this._eltArray = null; | ||
143 | this._planesArray = null; | ||
144 | } | ||
145 | } | ||
146 | }, | ||
147 | |||
138 | handleElementAdded: { | 148 | handleElementAdded: { |
139 | value: function(event) { | 149 | value: function(event) { |
140 | this.addElement(event.detail); | 150 | this.addElement(event.detail); |
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 562a6e73..2f0283a9 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js | |||
@@ -729,7 +729,10 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { | |||
729 | // the area of the polygon is the length of the normal | 729 | // the area of the polygon is the length of the normal |
730 | var area = VecUtils.vecMag(3, normal ); | 730 | var area = VecUtils.vecMag(3, normal ); |
731 | if (this.fpSign(area) != 0) | 731 | if (this.fpSign(area) != 0) |
732 | vec3.scale(normal, 1.0/area); | 732 | { |
733 | //vec3.scale(normal, 1.0/area); | ||
734 | normal = VecUtils.vecNormalize(3, normal, 1.0); | ||
735 | } | ||
733 | 736 | ||
734 | return normal; | 737 | return normal; |
735 | } | 738 | } |