diff options
author | Ananya Sen | 2012-02-08 15:37:23 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-08 15:37:23 -0800 |
commit | ab6f2f7ada39a9b27408575af9a565daf0a9d291 (patch) | |
tree | 92a796e34530d1a724ddb24ef22e59ffef13c12a /js/tools/RectTool.js | |
parent | 36b2e540f06cef3887e7d0fea60527fee51e2a40 (diff) | |
parent | 5a69d5be181ea98fa842977885ebd8c861dda6ca (diff) | |
download | ninja-ab6f2f7ada39a9b27408575af9a565daf0a9d291.tar.gz |
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-x | js/tools/RectTool.js | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index fbf1693e..31ac7faa 100755 --- 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); |
@@ -94,6 +94,14 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
94 | canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; | 94 | canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; |
95 | canvas.elementModel.shapeModel.stroke = strokeColor; | 95 | canvas.elementModel.shapeModel.stroke = strokeColor; |
96 | canvas.elementModel.shapeModel.fill = fillColor; | 96 | canvas.elementModel.shapeModel.fill = fillColor; |
97 | if(strokeColor) | ||
98 | { | ||
99 | canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; | ||
100 | } | ||
101 | if(fillColor) | ||
102 | { | ||
103 | canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill; | ||
104 | } | ||
97 | 105 | ||
98 | canvas.elementModel.shapeModel.tlRadius = this.options.TLRadiusControl.value + " " + this.options.TLRadiusControl.units; | 106 | canvas.elementModel.shapeModel.tlRadius = this.options.TLRadiusControl.value + " " + this.options.TLRadiusControl.units; |
99 | canvas.elementModel.shapeModel.trRadius = this.options.TRRadiusControl.value + " " + this.options.TRRadiusControl.units; | 107 | canvas.elementModel.shapeModel.trRadius = this.options.TRRadiusControl.value + " " + this.options.TRRadiusControl.units; |
@@ -102,13 +110,12 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
102 | 110 | ||
103 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; | 111 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; |
104 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; | 112 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; |
105 | canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; | ||
106 | canvas.elementModel.shapeModel.fillMaterialIndex = fillIndex; | ||
107 | 113 | ||
108 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; | 114 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; |
109 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; | 115 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; |
110 | 116 | ||
111 | canvas.elementModel.shapeModel.GLGeomObj = rect; | 117 | canvas.elementModel.shapeModel.GLGeomObj = rect; |
118 | canvas.elementModel.shapeModel.useWebGl = this.options.use3D; | ||
112 | } | 119 | } |
113 | else | 120 | else |
114 | { | 121 | { |