From 182f05f2f7a8f43f1589c9b8c15bf00d6e983676 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 6 Mar 2012 11:41:09 -0800 Subject: File IO --- js/helper-classes/3D/math-utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 37044763..f084cf9f 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js @@ -709,7 +709,10 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { // the area of the polygon is the length of the normal var area = VecUtils.vecMag(3, normal ); if (this.fpSign(area) != 0) - vec3.scale(normal, 1.0/area); + { + //vec3.scale(normal, 1.0/area); + normal = VecUtils.vecNormalize(3, normal, 1.0); + } return normal; } -- cgit v1.2.3 From 9e4ee2470726e3334eb47d904a6f4079d4ed7aef Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 17:01:39 -0800 Subject: IKNINJA-1270: fixed browser crashing when you close a document while playing a video then wait for a while Signed-off-by: Ananya Sen --- js/helper-classes/3D/draw-utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 02d946ae..63e7799a 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, { this.eventManager.addEventListener("elementDeleted", this, false); this.eventManager.addEventListener("deleteSelection", this, false); this.eventManager.addEventListener("elementChange", this, false); + this.eventManager.addEventListener("closeDocument", this, false); } }, @@ -135,6 +136,15 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { } }, + handleCloseDocument:{ + value: function() { + if(this.application.ninja.documentController._documents.length === 0){ + this._eltArray = []; + this._planesArray = []; + } + } + }, + handleElementAdded: { value: function(event) { this.addElement(event.detail); -- cgit v1.2.3 From 28e3a3cc8b4a2e37c29db2fa01c61c17d24de07a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 8 Mar 2012 13:54:11 -0800 Subject: null the arrays on all documents closed, so that they get garbage collected Signed-off-by: Ananya Sen --- js/helper-classes/3D/draw-utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 63e7799a..59da411f 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -139,8 +139,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { handleCloseDocument:{ value: function() { if(this.application.ninja.documentController._documents.length === 0){ - this._eltArray = []; - this._planesArray = []; + this._eltArray = null; + this._planesArray = null; } } }, -- cgit v1.2.3