diff options
Diffstat (limited to 'js/tools')
-rw-r--r-- | js/tools/LineTool.js | 8 | ||||
-rw-r--r-- | js/tools/OvalTool.js | 15 | ||||
-rw-r--r-- | js/tools/RectTool.js | 15 |
3 files changed, 18 insertions, 20 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 17157f23..99c374a7 100644 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -203,10 +203,10 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
203 | // for default stroke and fill/no materials | 203 | // for default stroke and fill/no materials |
204 | var strokeMaterial = null; | 204 | var strokeMaterial = null; |
205 | 205 | ||
206 | var strokeIndex = parseInt(this.options.strokeMaterial); | 206 | var strokeM = this.options.strokeMaterial; |
207 | if(strokeIndex > 0) | 207 | if(strokeM) |
208 | { | 208 | { |
209 | strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); | 209 | strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); |
210 | } | 210 | } |
211 | 211 | ||
212 | var world = this.getGLWorld(canvas, this.options.use3D); | 212 | var world = this.getGLWorld(canvas, this.options.use3D); |
@@ -232,12 +232,12 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
232 | } | 232 | } |
233 | 233 | ||
234 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; | 234 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; |
235 | canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; | ||
236 | 235 | ||
237 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; | 236 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; |
238 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; | 237 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; |
239 | 238 | ||
240 | canvas.elementModel.shapeModel.GLGeomObj = line; | 239 | canvas.elementModel.shapeModel.GLGeomObj = line; |
240 | canvas.elementModel.shapeModel.useWebGl = this.options.use3D; | ||
241 | } | 241 | } |
242 | else | 242 | else |
243 | { | 243 | { |
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 2fa5411b..14655312 100644 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js | |||
@@ -43,16 +43,16 @@ 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 strokeIndex = parseInt(this.options.strokeMaterial); | 46 | var strokeM = this.options.strokeMaterial; |
47 | if(strokeIndex > 0) | 47 | if(strokeM) |
48 | { | 48 | { |
49 | strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); | 49 | strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); |
50 | } | 50 | } |
51 | 51 | ||
52 | var fillIndex = parseInt(this.options.fillMaterial); | 52 | var fillM = this.options.fillMaterial; |
53 | if(fillIndex > 0) | 53 | if(fillM) |
54 | { | 54 | { |
55 | fillMaterial = Object.create(MaterialsLibrary.getMaterialAt(fillIndex-1)); | 55 | fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
@@ -88,13 +88,12 @@ exports.OvalTool = Montage.create(ShapeTool, { | |||
88 | 88 | ||
89 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; | 89 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; |
90 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; | 90 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; |
91 | canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; | ||
92 | canvas.elementModel.shapeModel.fillMaterialIndex = fillIndex; | ||
93 | 91 | ||
94 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; | 92 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; |
95 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; | 93 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; |
96 | 94 | ||
97 | canvas.elementModel.shapeModel.GLGeomObj = oval; | 95 | canvas.elementModel.shapeModel.GLGeomObj = oval; |
96 | canvas.elementModel.shapeModel.useWebGl = this.options.use3D; | ||
98 | } | 97 | } |
99 | else | 98 | else |
100 | { | 99 | { |
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 94d80b53..31ac7faa 100644 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js | |||
@@ -62,16 +62,16 @@ 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 strokeIndex = parseInt(this.options.strokeMaterial); | 65 | var strokeM = this.options.strokeMaterial; |
66 | if(strokeIndex > 0) | 66 | if(strokeM) |
67 | { | 67 | { |
68 | strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); | 68 | strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); |
69 | } | 69 | } |
70 | 70 | ||
71 | var fillIndex = parseInt(this.options.fillMaterial); | 71 | var fillM = this.options.fillMaterial; |
72 | if(fillIndex > 0) | 72 | if(fillM) |
73 | { | 73 | { |
74 | fillMaterial = Object.create(MaterialsLibrary.getMaterialAt(fillIndex-1)); | 74 | fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); |
75 | } | 75 | } |
76 | 76 | ||
77 | var world = this.getGLWorld(canvas, this.options.use3D); | 77 | var world = this.getGLWorld(canvas, this.options.use3D); |
@@ -110,13 +110,12 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
110 | 110 | ||
111 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; | 111 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; |
112 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; | 112 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; |
113 | canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; | ||
114 | canvas.elementModel.shapeModel.fillMaterialIndex = fillIndex; | ||
115 | 113 | ||
116 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; | 114 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; |
117 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; | 115 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; |
118 | 116 | ||
119 | canvas.elementModel.shapeModel.GLGeomObj = rect; | 117 | canvas.elementModel.shapeModel.GLGeomObj = rect; |
118 | canvas.elementModel.shapeModel.useWebGl = this.options.use3D; | ||
120 | } | 119 | } |
121 | else | 120 | else |
122 | { | 121 | { |