aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/tools/LineTool.js9
-rwxr-xr-xjs/tools/OvalTool.js20
-rwxr-xr-xjs/tools/RectTool.js19
-rwxr-xr-xjs/tools/SelectionTool.js5
4 files changed, 32 insertions, 21 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 0a7c0534..32572af1 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -206,10 +206,13 @@ exports.LineTool = Montage.create(ShapeTool, {
206 // for default stroke and fill/no materials 206 // for default stroke and fill/no materials
207 var strokeMaterial = null; 207 var strokeMaterial = null;
208 208
209 var strokeM = this.options.strokeMaterial; 209 if(this.options.use3D)
210 if(strokeM)
211 { 210 {
212 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); 211 var strokeM = this.options.strokeMaterial;
212 if(strokeM)
213 {
214 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM));
215 }
213 } 216 }
214 217
215 var world = this.getGLWorld(canvas, this.options.use3D); 218 var world = this.getGLWorld(canvas, this.options.use3D);
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index 14655312..911059a7 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -43,19 +43,21 @@ exports.OvalTool = Montage.create(ShapeTool, {
43 var strokeMaterial = null; 43 var strokeMaterial = null;
44 var fillMaterial = null; 44 var fillMaterial = null;
45 45
46 var strokeM = this.options.strokeMaterial; 46 if(this.options.use3D)
47 if(strokeM)
48 { 47 {
49 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); 48 var strokeM = this.options.strokeMaterial;
50 } 49 if(strokeM)
50 {
51 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM));
52 }
51 53
52 var fillM = this.options.fillMaterial; 54 var fillM = this.options.fillMaterial;
53 if(fillM) 55 if(fillM)
54 { 56 {
55 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); 57 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM));
58 }
56 } 59 }
57 60
58
59 var world = this.getGLWorld(canvas, this.options.use3D); 61 var world = this.getGLWorld(canvas, this.options.use3D);
60 62
61 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); 63 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2);
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index 31ac7faa..5e148de3 100755
--- a/js/tools/RectTool.js
+++ b/js/tools/RectTool.js
@@ -62,16 +62,19 @@ exports.RectTool = Montage.create(ShapeTool, {
62 var strokeMaterial = null; 62 var strokeMaterial = null;
63 var fillMaterial = null; 63 var fillMaterial = null;
64 64
65 var strokeM = this.options.strokeMaterial; 65 if(this.options.use3D)
66 if(strokeM)
67 { 66 {
68 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); 67 var strokeM = this.options.strokeMaterial;
69 } 68 if(strokeM)
69 {
70 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM));
71 }
70 72
71 var fillM = this.options.fillMaterial; 73 var fillM = this.options.fillMaterial;
72 if(fillM) 74 if(fillM)
73 { 75 {
74 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); 76 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM));
77 }
75 } 78 }
76 79
77 var world = this.getGLWorld(canvas, this.options.use3D); 80 var world = this.getGLWorld(canvas, this.options.use3D);
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index caa9e8d6..3df9a532 100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -122,6 +122,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
122 if(this._escape) { 122 if(this._escape) {
123 this._escape = false; 123 this._escape = false;
124 this._isSelecting = false; 124 this._isSelecting = false;
125 this._canSnap = true;
125 return; 126 return;
126 } 127 }
127 128
@@ -153,6 +154,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
153 } 154 }
154 155
155 this.endDraw(event); 156 this.endDraw(event);
157 this._canSnap = true;
156 return; 158 return;
157 } 159 }
158 160
@@ -180,6 +182,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
180 } 182 }
181 183
182 this.endDraw(event); 184 this.endDraw(event);
185 this._canSnap = true;
183 } 186 }
184 }, 187 },
185 188
@@ -400,7 +403,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
400 case 0: 403 case 0:
401 // Resize North-West 404 // Resize North-West
402 delta = ~~(data.pt1[0] - data.pt0[0]); 405 delta = ~~(data.pt1[0] - data.pt0[0]);
403 deltaW = this._undoArray.map(function(item) { return item._w + delta + "px"}); 406 deltaW = this._undoArray.map(function(item) { return item._w - delta + "px"});
404 deltaL = this._undoArray.map(function(item) { return item._x + delta + "px"}); 407 deltaL = this._undoArray.map(function(item) { return item._x + delta + "px"});
405 delta = ~~(data.pt1[1] - data.pt0[1]); 408 delta = ~~(data.pt1[1] - data.pt0[1]);
406 deltaH = this._undoArray.map(function(item) { return item._h - delta + "px"}); 409 deltaH = this._undoArray.map(function(item) { return item._h - delta + "px"});