aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-06 13:42:27 -0800
committerNivesh Rajbhandari2012-03-06 13:42:27 -0800
commit3fcb463816a399b5474114725322653a20a22e9a (patch)
tree44517af04f2680b5c9fec8c9e37aed4422bcf852 /js/document
parent11c3fa444217a34fa481b156d4d919d10e817350 (diff)
downloadninja-3fcb463816a399b5474114725322653a20a22e9a.tar.gz
Updated buildShapeModel to set PI and selection values too and also avoid fill material for lines.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index f1847357..00cf0164 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -226,7 +226,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
226 world.import( importStr ); 226 world.import( importStr );
227 canvas.elementModel.shapeModel.GLWorld = world; 227 canvas.elementModel.shapeModel.GLWorld = world;
228 228
229 this.buildShapeModel( canvas.elementModel.shapeModel, world ); 229 this.buildShapeModel( canvas.elementModel, world );
230 } 230 }
231 } 231 }
232 } 232 }
@@ -240,8 +240,9 @@ exports.HTMLDocument = Montage.create(TextDocument, {
240 240
241 buildShapeModel: 241 buildShapeModel:
242 { 242 {
243 value: function( shapeModel, world ) 243 value: function( elementModel, world )
244 { 244 {
245 var shapeModel = elementModel.shapeModel;
245 shapeModel.shapeCount = 1; // for now... 246 shapeModel.shapeCount = 1; // for now...
246 shapeModel.useWebGl = world._useWebGL; 247 shapeModel.useWebGl = world._useWebGL;
247 shapeModel.GLWorld = world; 248 shapeModel.GLWorld = world;
@@ -255,12 +256,14 @@ exports.HTMLDocument = Montage.create(TextDocument, {
255 shapeModel.strokeStyle = "solid"; 256 shapeModel.strokeStyle = "solid";
256 //shapeModel.strokeStyleIndex 257 //shapeModel.strokeStyleIndex
257 //shapeModel.border 258 //shapeModel.border
258 shapeModel.fill = root._fillColor.slice();
259 shapeModel.fillMaterial = root._fillMaterial.dup();
260 //shapeModel.background 259 //shapeModel.background
261 switch (root.geomType()) 260 switch (root.geomType())
262 { 261 {
263 case root.GEOM_TYPE_RECTANGLE: 262 case root.GEOM_TYPE_RECTANGLE:
263 elementModel.selection = "Rectangle";
264 elementModel.pi = "RectanglePi";
265 shapeModel.fill = root._fillColor.slice();
266 shapeModel.fillMaterial = root._fillMaterial.dup();
264 shapeModel.tlRadius = root._tlRadius; 267 shapeModel.tlRadius = root._tlRadius;
265 shapeModel.trRadius = root._trRadius; 268 shapeModel.trRadius = root._trRadius;
266 shapeModel.blRadius = root._blRadius; 269 shapeModel.blRadius = root._blRadius;
@@ -268,10 +271,16 @@ exports.HTMLDocument = Montage.create(TextDocument, {
268 break; 271 break;
269 272
270 case root.GEOM_TYPE_CIRCLE: 273 case root.GEOM_TYPE_CIRCLE:
274 elementModel.selection = "Oval";
275 elementModel.pi = "OvalPi";
276 shapeModel.fill = root._fillColor.slice();
277 shapeModel.fillMaterial = root._fillMaterial.dup();
271 shapeModel.innerRadius = root._innerRadius; 278 shapeModel.innerRadius = root._innerRadius;
272 break; 279 break;
273 280
274 case root.GEOM_TYPE_LINE: 281 case root.GEOM_TYPE_LINE:
282 elementModel.selection = "Line";
283 elementModel.pi = "LinePi";
275 shapeModel.slope = root._slope; 284 shapeModel.slope = root._slope;
276 break; 285 break;
277 286