diff options
author | Jose Antonio Marquez | 2012-04-04 11:51:08 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-04-04 11:51:08 -0700 |
commit | e2ed78b699c3f2353bdf636629956c2a3ef319be (patch) | |
tree | b9b2f9e175b710f9b37b17b470587a5af43075d2 /js/stage | |
parent | bc04ee998de7aaadc457f4e932cc4be8327a2a03 (diff) | |
parent | 8482e23cd9b8c4700b5130f2588e5eb24d376536 (diff) | |
download | ninja-e2ed78b699c3f2353bdf636629956c2a3ef319be.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/layout.js | 18 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.js | 5 |
2 files changed, 10 insertions, 13 deletions
diff --git a/js/stage/layout.js b/js/stage/layout.js index 6be2df1d..ae9260fc 100755 --- a/js/stage/layout.js +++ b/js/stage/layout.js | |||
@@ -53,12 +53,8 @@ exports.Layout = Montage.create(Component, { | |||
53 | this.ctx.lineWidth = this.ctxLineWidth; | 53 | this.ctx.lineWidth = this.ctxLineWidth; |
54 | this.ctx.fillStyle = this.drawFillColor; | 54 | this.ctx.fillStyle = this.drawFillColor; |
55 | 55 | ||
56 | // this.eventManager.addEventListener("elementAdded", this, false); | ||
57 | this.eventManager.addEventListener("elementDeleted", this, false); | ||
58 | |||
59 | this.eventManager.addEventListener("selectionChange", this, false); | 56 | this.eventManager.addEventListener("selectionChange", this, false); |
60 | 57 | this.eventManager.addEventListener("elementsRemoved", this, false); | |
61 | this.eventManager.addEventListener("deleteSelection", this, false); | ||
62 | } | 58 | } |
63 | }, | 59 | }, |
64 | 60 | ||
@@ -76,7 +72,7 @@ exports.Layout = Montage.create(Component, { | |||
76 | }, | 72 | }, |
77 | 73 | ||
78 | // Redraw stage only once after all deletion is completed | 74 | // Redraw stage only once after all deletion is completed |
79 | handleDeleteSelection: { | 75 | handleElementsRemoved: { |
80 | value: function(event) { | 76 | value: function(event) { |
81 | this.draw(); | 77 | this.draw(); |
82 | this.draw3DInfo(false); | 78 | this.draw3DInfo(false); |
@@ -110,10 +106,8 @@ exports.Layout = Montage.create(Component, { | |||
110 | 106 | ||
111 | // Draw the non selected elements | 107 | // Draw the non selected elements |
112 | if(!event.detail.isDocument) { | 108 | if(!event.detail.isDocument) { |
113 | var tmp = event.detail.elements.map(function(element){ return element._element}); | ||
114 | |||
115 | this.elementsToDraw = this.domTree.filter(function(value) { | 109 | this.elementsToDraw = this.domTree.filter(function(value) { |
116 | return (tmp.indexOf(value) === -1); | 110 | return (event.detail.elements.indexOf(value) === -1); |
117 | }); | 111 | }); |
118 | } else { | 112 | } else { |
119 | this.elementsToDraw = Array.prototype.slice.call(this.domTree, 0); | 113 | this.elementsToDraw = Array.prototype.slice.call(this.domTree, 0); |
@@ -345,7 +339,11 @@ exports.Layout = Montage.create(Component, { | |||
345 | 339 | ||
346 | _elementName: { | 340 | _elementName: { |
347 | value: function(item) { | 341 | value: function(item) { |
348 | return this.application.ninja.elementMediator.getNJProperty(item, "selection"); | 342 | if(item.elementModel && item.elementModel.hasOwnProperty("selection")) { |
343 | return item.elementModel['selection']; | ||
344 | } else { | ||
345 | return ""; | ||
346 | } | ||
349 | } | 347 | } |
350 | } | 348 | } |
351 | 349 | ||
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 00b72490..3500b6a3 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -560,8 +560,7 @@ exports.Stage = Montage.create(Component, { | |||
560 | elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); | 560 | elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); |
561 | 561 | ||
562 | // workaround Chrome 3d bug | 562 | // workaround Chrome 3d bug |
563 | if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(elt) !== -1) | 563 | if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(elt) !== -1) { |
564 | { | ||
565 | return this._getElementUsingSnapping(point); | 564 | return this._getElementUsingSnapping(point); |
566 | } else { | 565 | } else { |
567 | return elt; | 566 | return elt; |
@@ -605,7 +604,7 @@ exports.Stage = Montage.create(Component, { | |||
605 | var selArray = new Array(); | 604 | var selArray = new Array(); |
606 | 605 | ||
607 | for(var i = 0; this.application.ninja.selectedElements[i];i++) { | 606 | for(var i = 0; this.application.ninja.selectedElements[i];i++) { |
608 | var curElement = this.application.ninja.selectedElements[i]._element; | 607 | var curElement = this.application.ninja.selectedElements[i]; |
609 | 608 | ||
610 | // Add element to array that is used to calculate 3d-bounding box of all elements | 609 | // Add element to array that is used to calculate 3d-bounding box of all elements |
611 | selArray.push( curElement ); | 610 | selArray.push( curElement ); |