diff options
author | hwc487 | 2012-02-02 15:10:06 -0800 |
---|---|---|
committer | hwc487 | 2012-02-02 15:10:06 -0800 |
commit | e02deaf0d1b1f7dbcf022442cb730490ac8cee8b (patch) | |
tree | d1a171a285f41c640b0ab0c8e830406ca6de113d | |
parent | 4ebae7378608750192f8d3bb392a54222ca0ec2f (diff) | |
parent | d41dee0c552a30724a146965ae4272a268777fc5 (diff) | |
download | ninja-e02deaf0d1b1f7dbcf022442cb730490ac8cee8b.tar.gz |
Merge branch 'ToolFixes' of github.com:mqg734/ninja-internal into working
-rw-r--r-- | js/components/tools-properties/rect-properties.reel/rect-properties.js | 2 | ||||
-rw-r--r-- | js/controllers/elements/shapes-controller.js | 28 | ||||
-rw-r--r-- | js/data/pi/pi-data.js | 48 | ||||
-rw-r--r-- | js/helper-classes/3D/math-utils.js | 54 | ||||
-rw-r--r-- | js/panels/properties/content.reel/content.js | 7 | ||||
-rw-r--r-- | js/tools/PanTool.js | 2 | ||||
-rw-r--r-- | js/tools/ZoomTool.js | 8 |
7 files changed, 102 insertions, 47 deletions
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index 8d0cd21f..1e717f88 100644 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js | |||
@@ -113,7 +113,7 @@ exports.RectProperties = Montage.create(ToolProperties, { | |||
113 | 113 | ||
114 | handleChange: { | 114 | handleChange: { |
115 | value: function(event) { | 115 | value: function(event) { |
116 | var hotTxt = event.currentTarget | 116 | var hotTxt = event.currentTarget; |
117 | if(hotTxt.units === "%") { | 117 | if(hotTxt.units === "%") { |
118 | if(hotTxt.value > 50) { | 118 | if(hotTxt.value > 50) { |
119 | hotTxt.maxValue = 50; | 119 | hotTxt.maxValue = 50; |
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index d34644a7..c5f22138 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -24,6 +24,26 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
24 | el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100); | 24 | el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100); |
25 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | 25 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); |
26 | break; | 26 | break; |
27 | case "tlRadius": | ||
28 | this.setShapeProperty(el, "tlRadius", value); | ||
29 | el.elementModel.shapeModel.GLGeomObj.setTLRadius(val); | ||
30 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | ||
31 | break; | ||
32 | case "trRadius": | ||
33 | this.setShapeProperty(el, "trRadius", value); | ||
34 | el.elementModel.shapeModel.GLGeomObj.setTRRadius(val); | ||
35 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | ||
36 | break; | ||
37 | case "blRadius": | ||
38 | this.setShapeProperty(el, "blRadius", value); | ||
39 | el.elementModel.shapeModel.GLGeomObj.setBLRadius(val); | ||
40 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | ||
41 | break; | ||
42 | case "brRadius": | ||
43 | this.setShapeProperty(el, "brRadius", value); | ||
44 | el.elementModel.shapeModel.GLGeomObj.setBRRadius(val); | ||
45 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | ||
46 | break; | ||
27 | case "width": | 47 | case "width": |
28 | el.elementModel.shapeModel.GLGeomObj.setWidth(val); | 48 | el.elementModel.shapeModel.GLGeomObj.setWidth(val); |
29 | CanvasController.setProperty(el, p, value); | 49 | CanvasController.setProperty(el, p, value); |
@@ -46,8 +66,16 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
46 | getProperty: { | 66 | getProperty: { |
47 | value: function(el, p) { | 67 | value: function(el, p) { |
48 | switch(p) { | 68 | switch(p) { |
69 | case "stroke": | ||
70 | case "fill": | ||
49 | case "strokeSize": | 71 | case "strokeSize": |
50 | case "innerRadius": | 72 | case "innerRadius": |
73 | case "tlRadius": | ||
74 | case "trRadius": | ||
75 | case "blRadius": | ||
76 | case "brRadius": | ||
77 | case "strokeMaterial": | ||
78 | case "fillMaterial": | ||
51 | return this.getShapeProperty(el, p); | 79 | return this.getShapeProperty(el, p); |
52 | default: | 80 | default: |
53 | return CanvasController.getProperty(el, p); | 81 | return CanvasController.getProperty(el, p); |
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index f162e919..de5cd34d 100644 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js | |||
@@ -279,11 +279,13 @@ exports.PiData = Montage.create( Montage, { | |||
279 | [ | 279 | [ |
280 | { | 280 | { |
281 | type : "color", | 281 | type : "color", |
282 | id : "stroke" | 282 | id : "stroke", |
283 | prop : "stroke" | ||
283 | }, | 284 | }, |
284 | { | 285 | { |
285 | type : "color", | 286 | type : "color", |
286 | id : "fill", | 287 | id : "fill", |
288 | prop : "fill", | ||
287 | divider : true | 289 | divider : true |
288 | } | 290 | } |
289 | ], | 291 | ], |
@@ -313,10 +315,11 @@ exports.PiData = Montage.create( Montage, { | |||
313 | id: "tlRadius", | 315 | id: "tlRadius", |
314 | prop : "tlRadius", | 316 | prop : "tlRadius", |
315 | label: "TL", | 317 | label: "TL", |
318 | valueMutator: parseFloat, | ||
316 | value : 0, | 319 | value : 0, |
317 | min : 0, | 320 | min : 0, |
318 | max : 100, | 321 | max : 100, |
319 | unit : "%", | 322 | unit : "px", |
320 | acceptableUnits: ["px", "pt", "%"] | 323 | acceptableUnits: ["px", "pt", "%"] |
321 | }, | 324 | }, |
322 | { | 325 | { |
@@ -324,10 +327,12 @@ exports.PiData = Montage.create( Montage, { | |||
324 | id : "trRadius", | 327 | id : "trRadius", |
325 | prop : "trRadius", | 328 | prop : "trRadius", |
326 | label : "TR", | 329 | label : "TR", |
330 | valueMutator: parseFloat, | ||
327 | min : 0, | 331 | min : 0, |
328 | max : 100, | 332 | max : 100, |
329 | unit : "%", | 333 | unit : "px", |
330 | acceptableUnits: ["px", "pt", "%"] | 334 | acceptableUnits: ["px", "pt", "%"], |
335 | divider: true | ||
331 | } | 336 | } |
332 | ], | 337 | ], |
333 | [ | 338 | [ |
@@ -336,9 +341,10 @@ exports.PiData = Montage.create( Montage, { | |||
336 | id : "blRadius", | 341 | id : "blRadius", |
337 | prop : "blRadius", | 342 | prop : "blRadius", |
338 | label : "BL", | 343 | label : "BL", |
344 | valueMutator: parseFloat, | ||
339 | min : 0, | 345 | min : 0, |
340 | max : 100, | 346 | max : 100, |
341 | unit : "%", | 347 | unit : "px", |
342 | acceptableUnits: ["px", "pt", "%"] | 348 | acceptableUnits: ["px", "pt", "%"] |
343 | }, | 349 | }, |
344 | { | 350 | { |
@@ -346,9 +352,10 @@ exports.PiData = Montage.create( Montage, { | |||
346 | id : "brRadius", | 352 | id : "brRadius", |
347 | prop : "brRadius", | 353 | prop : "brRadius", |
348 | label : "BR", | 354 | label : "BR", |
355 | valueMutator: parseFloat, | ||
349 | min : 0, | 356 | min : 0, |
350 | max : 100, | 357 | max : 100, |
351 | unit : "%", | 358 | unit : "px", |
352 | acceptableUnits: ["px", "pt", "%"] | 359 | acceptableUnits: ["px", "pt", "%"] |
353 | } | 360 | } |
354 | ] | 361 | ] |
@@ -362,13 +369,18 @@ exports.PiData = Montage.create( Montage, { | |||
362 | { | 369 | { |
363 | type: "dropdown", | 370 | type: "dropdown", |
364 | id: "strokeMaterial", | 371 | id: "strokeMaterial", |
372 | prop: "strokeMaterial", | ||
365 | label: "Stroke", | 373 | label: "Stroke", |
366 | labelField: "_name", | 374 | labelField: "_name", |
367 | items : { boundObject: "this.application.ninja.appModel", boundProperty: "materials" } | 375 | items : { boundObject: "this.application.ninja.appModel", boundProperty: "materials" }, |
368 | }, | 376 | divider : true |
377 | } | ||
378 | ], | ||
379 | [ | ||
369 | { | 380 | { |
370 | type: "dropdown", | 381 | type: "dropdown", |
371 | id: "fillMaterial", | 382 | id: "fillMaterial", |
383 | prop: "fillMaterial", | ||
372 | label: "Fill", | 384 | label: "Fill", |
373 | labelField: "_name", | 385 | labelField: "_name", |
374 | items : { boundObject: "this.application.ninja.appModel", boundProperty: "materials" } | 386 | items : { boundObject: "this.application.ninja.appModel", boundProperty: "materials" } |
@@ -387,7 +399,8 @@ exports.PiData = Montage.create( Montage, { | |||
387 | [ | 399 | [ |
388 | { | 400 | { |
389 | type : "color", | 401 | type : "color", |
390 | id : "stroke" | 402 | id : "stroke", |
403 | prop : "stroke" | ||
391 | }, | 404 | }, |
392 | { | 405 | { |
393 | type : "color", | 406 | type : "color", |
@@ -438,11 +451,13 @@ exports.PiData = Montage.create( Montage, { | |||
438 | [ | 451 | [ |
439 | { | 452 | { |
440 | type : "color", | 453 | type : "color", |
441 | id : "stroke" | 454 | id : "stroke", |
455 | prop : "stroke" | ||
442 | }, | 456 | }, |
443 | { | 457 | { |
444 | type : "color", | 458 | type : "color", |
445 | id : "fill", | 459 | id : "fill", |
460 | prop : "fill", | ||
446 | divider : true | 461 | divider : true |
447 | } | 462 | } |
448 | ], | 463 | ], |
@@ -452,7 +467,6 @@ exports.PiData = Montage.create( Montage, { | |||
452 | id : "strokeSize", | 467 | id : "strokeSize", |
453 | prop : "strokeSize", | 468 | prop : "strokeSize", |
454 | label : "Stroke", | 469 | label : "Stroke", |
455 | valueMutator: parseFloat, | ||
456 | min : 0, | 470 | min : 0, |