diff options
author | Armen Kesablyan | 2012-06-11 11:04:29 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-11 11:04:29 -0700 |
commit | 0f040acabfb7a4bf3138debec5aff869487ceb11 (patch) | |
tree | 53eaa8ba54cf23a1c3ea0c8b39377773198c3e19 /js/tools/TagTool.js | |
parent | 7d3bdf39e6d1534de1848ca2744aed66dfeb5d2a (diff) | |
parent | 756cbfad2b98b300af8db3793aa21718b88dd950 (diff) | |
download | ninja-0f040acabfb7a4bf3138debec5aff869487ceb11.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'js/tools/TagTool.js')
-rwxr-xr-x | js/tools/TagTool.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 5520fa89..508e2a85 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js | |||
@@ -51,16 +51,20 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
51 | 51 | ||
52 | HandleLeftButtonUp: { | 52 | HandleLeftButtonUp: { |
53 | value: function(event) { | 53 | value: function(event) { |
54 | var w, h; | ||
54 | if(this._escape) { | 55 | if(this._escape) { |
55 | this._escape = false; | 56 | this._escape = false; |
56 | return; | 57 | return; |
57 | } | 58 | } |
58 | 59 | ||
59 | if(this._hasDraw) { | 60 | if(this._hasDraw) { |
60 | var drawData = this.getDrawingData(); | 61 | this.drawData = this.getDrawingData(); |
61 | 62 | if(this.drawData) { | |
62 | if(drawData) { | 63 | w = Math.floor(this.drawData.width); |
63 | this.insertElement(drawData); | 64 | h = Math.floor(this.drawData.height); |
65 | if( (w > 0) && (h > 0) ) { | ||
66 | this.insertElement(this.drawData); | ||
67 | } | ||
64 | } | 68 | } |
65 | 69 | ||
66 | this._hasDraw = false; | 70 | this._hasDraw = false; |
@@ -86,9 +90,6 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
86 | element = document.application.njUtils.make(this.options.selectedElement, null, this.application.ninja.currentDocument); | 90 | element = document.application.njUtils.make(this.options.selectedElement, null, this.application.ninja.currentDocument); |
87 | } | 91 | } |
88 | 92 | ||
89 | // Create the model | ||
90 | document.application.njUtils.createModel(element); | ||
91 | |||
92 | // Create the styles | 93 | // Create the styles |
93 | styles = document.application.njUtils.stylesFromDraw(element, ~~drawData.width, ~~drawData.height, drawData); | 94 | styles = document.application.njUtils.stylesFromDraw(element, ~~drawData.width, ~~drawData.height, drawData); |
94 | 95 | ||