diff options
author | Armen Kesablyan | 2012-02-13 11:59:19 -0800 |
---|---|---|
committer | Armen Kesablyan | 2012-02-13 11:59:19 -0800 |
commit | 90d0c8c0e98d062c628c061fe5765ce991fda409 (patch) | |
tree | 9780e9dcf475bf319f3cacc1a1ad52fcf9f133af /js/helper-classes/RDGE/GLGeomObj.js | |
parent | 8110e01dc5093ac6baf621103dcaa5f769e5be92 (diff) | |
parent | e142611e22718b1f1d1696902ad9161ec5f33f98 (diff) | |
download | ninja-90d0c8c0e98d062c628c061fe5765ce991fda409.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Conflicts:
css/ninja.css
js/stage/stage.reel/stage.html
js/tools/TextTool.js
node_modules/labs/rich-text-editor.reel/rich-text-editor.css
node_modules/labs/rich-text-editor.reel/rich-text-editor.html
node_modules/labs/rich-text-editor.reel/rich-text-editor.js
node_modules/labs/rich-text-editor.reel/rich-text-resizer.js
node_modules/labs/rich-text-editor.reel/rich-text-sanitizer.js
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/helper-classes/RDGE/GLGeomObj.js')
-rw-r--r-- | js/helper-classes/RDGE/GLGeomObj.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/js/helper-classes/RDGE/GLGeomObj.js b/js/helper-classes/RDGE/GLGeomObj.js index 72019703..5d7497ad 100644 --- a/js/helper-classes/RDGE/GLGeomObj.js +++ b/js/helper-classes/RDGE/GLGeomObj.js | |||
@@ -37,6 +37,10 @@ function GLGeomObj() | |||
37 | 37 | ||
38 | this.m_world = null; | 38 | this.m_world = null; |
39 | 39 | ||
40 | // stroke and fill colors | ||
41 | this._strokeColor; | ||
42 | this._fillColor; | ||
43 | |||
40 | // stroke and fill materials | 44 | // stroke and fill materials |
41 | this._fillMaterial; | 45 | this._fillMaterial; |
42 | this._strokeMaterial; | 46 | this._strokeMaterial; |
@@ -99,11 +103,61 @@ function GLGeomObj() | |||
99 | } | 103 | } |
100 | } | 104 | } |
101 | } | 105 | } |
106 | |||
107 | var world = this.getWorld(); | ||
108 | if (world) world.restartRenderLoop(); | ||
102 | } | 109 | } |
103 | 110 | ||
104 | this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); } | 111 | this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); } |
105 | this.setStrokeColor = function(c) { this.setMaterialColor(c, "stroke"); } | 112 | this.setStrokeColor = function(c) { this.setMaterialColor(c, "stroke"); } |
106 | 113 | ||
114 | this.makeStrokeMaterial = function() | ||
115 | { | ||
116 | var strokeMaterial; | ||
117 | if (this.getStrokeMaterial()) | ||
118 | strokeMaterial = this.getStrokeMaterial().dup(); | ||
119 | else | ||
120 | strokeMaterial = new FlatMaterial(); | ||
121 | |||
122 | if (strokeMaterial) | ||
123 | { | ||
124 | strokeMaterial.init( this.getWorld() ); | ||
125 | if(this._strokeColor) | ||
126 | { | ||
127 | strokeMaterial.setProperty("color", this._strokeColor); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | this._materialArray.push( strokeMaterial ); | ||
132 | this._materialTypeArray.push( "stroke" ); | ||
133 | |||
134 | return strokeMaterial; | ||
135 | } | ||
136 | |||
137 | this.makeFillMaterial = function() | ||
138 | { | ||
139 | var fillMaterial; | ||
140 | if (this.getFillMaterial()) | ||
141 | fillMaterial = this.getFillMaterial().dup(); | ||
142 | else | ||
143 | fillMaterial = new FlatMaterial(); | ||
144 | |||
145 | if (fillMaterial) | ||
146 | { | ||
147 | fillMaterial.init( this.getWorld() ); | ||
148 | //if(!this.getFillMaterial() && this._fillColor) | ||
149 | if (this._fillColor) | ||
150 | { | ||
151 | fillMaterial.setProperty("color", this._fillColor); | ||
152 | } | ||
153 | } | ||
154 | |||
155 | this._materialArray.push( fillMaterial ); | ||
156 | this._materialTypeArray.push( "fill" ); | ||
157 | |||
158 | return fillMaterial; | ||
159 | } | ||
160 | |||
107 | 161 | ||
108 | this.translate = function(v) | 162 | this.translate = function(v) |
109 | { | 163 | { |