aboutsummaryrefslogtreecommitdiff
path: root/js/tools/TagTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/TagTool.js')
-rwxr-xr-xjs/tools/TagTool.js15
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