aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--credits.html9
-rwxr-xr-xjs/data/tools-data.js6
-rwxr-xr-xjs/document/html-document.js4
-rwxr-xr-xjs/helper-classes/RDGE/GLCircle.js140
-rwxr-xr-xjs/helper-classes/RDGE/GLGeomObj.js4
-rwxr-xr-xjs/helper-classes/RDGE/GLLine.js67
-rwxr-xr-xjs/helper-classes/RDGE/GLRectangle.js81
-rwxr-xr-xjs/helper-classes/RDGE/GLWorld.js2
-rw-r--r--js/mediators/io-mediator.js61
-rwxr-xr-xjs/mediators/keyboard-mediator.js9
-rwxr-xr-xjs/tools/LineTool.js5
-rwxr-xr-xjs/tools/PanTool.js23
-rwxr-xr-xjs/tools/Rotate3DToolBase.js11
-rwxr-xr-xjs/tools/Translate3DToolBase.js1
14 files changed, 233 insertions, 190 deletions
diff --git a/credits.html b/credits.html
index 1cc36c78..082eefd4 100644
--- a/credits.html
+++ b/credits.html
@@ -95,5 +95,14 @@
95 <li>License: <a href="http://www.opensource.org/licenses/mit-license.php" target="_blank">http://www.opensource.org/licenses/mit-license.php</a></li> 95 <li>License: <a href="http://www.opensource.org/licenses/mit-license.php" target="_blank">http://www.opensource.org/licenses/mit-license.php</a></li>
96 </ul> 96 </ul>
97 </div> 97 </div>
98
99 <div>
100 js-beautify
101 <ul>
102 <li>Written by Einar Lielmanis, <a href="mailto:einar@jsbeautifier.org">einar@jsbeautifier.org</a>. Python version flourished by <a href="http://github.com/satufk">Stefano Sanfilippo</a> with help from <a href="http://jason.diamond.name/weblog/">Jason&nbsp;Diamond</a>, Patrick&nbsp;Hof, Nochum&nbsp;Sossonko, Andreas&nbsp;Schneider, Dave&nbsp;Vasilevsky, <a href="http://my.opera.com/Vital/blog/">Vital&nbsp;Batmanov,</a> Ron&nbsp;Baldwin, Gabriel&nbsp;Harrison, <a href="http://shullian.com">Chris&nbsp;J.&nbsp;Shull</a>, <a href="http://mathiasbynens.be/">Mathias Bynens</a> and others.</li>
103 <li>Code from: <a href="https://github.com/einars/js-beautify" target="_blank">https://github.com/einars/js-beautify</a></li>
104 <li>License: <a href="https://github.com/einars/js-beautify/blob/master/license.txt" target="_blank">https://github.com/einars/js-beautify/blob/master/license.txt</a></li>
105 </ul>
106 </div>
98 </body> 107 </body>
99</html> \ No newline at end of file 108</html> \ No newline at end of file
diff --git a/js/data/tools-data.js b/js/data/tools-data.js
index cf48757d..a3a30b57 100755
--- a/js/data/tools-data.js
+++ b/js/data/tools-data.js
@@ -37,7 +37,7 @@ exports.ToolsData = Montage.create(Montage, {
37 "properties": "rotate3DProperties", 37 "properties": "rotate3DProperties",
38 "spriteSheet": true, 38 "spriteSheet": true,
39 "action": "Rotate3DTool", 39 "action": "Rotate3DTool",
40 "toolTip": "3D Rotate Object Tool (W)", 40 "toolTip": "3D Object Rotate Tool (W)",
41 "cursor": "auto", 41 "cursor": "auto",
42 "lastInGroup": false, 42 "lastInGroup": false,
43 "container": false, 43 "container": false,
@@ -48,7 +48,7 @@ exports.ToolsData = Montage.create(Montage, {
48 "properties": "translate3DProperties", 48 "properties": "translate3DProperties",
49 "spriteSheet": true, 49 "spriteSheet": true,
50 "action": "Translate3DTool", 50 "action": "Translate3DTool",
51 "toolTip": "3D Translate Object Tool (G)", 51 "toolTip": "3D Object Translate Tool (G)",
52 "cursor": "auto", 52 "cursor": "auto",
53 "lastInGroup": true, 53 "lastInGroup": true,
54 "container": false, 54 "container": false,
@@ -195,7 +195,7 @@ exports.ToolsData = Montage.create(Montage, {
195 "properties": "rotateStageProperties", 195 "properties": "rotateStageProperties",
196 "spriteSheet": true, 196 "spriteSheet": true,
197 "action": "RotateStageTool3D", 197 "action": "RotateStageTool3D",
198 "toolTip": "3D Rotate Stage Tool", 198 "toolTip": "3D Stage Rotate Tool (M)",
199 "cursor": "auto", 199 "cursor": "auto",
200 "lastInGroup": false, 200 "lastInGroup": false,
201 "container": false, 201 "container": false,
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 76436732..75628731 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -679,6 +679,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
679 if(typeof this.application.ninja.selectedElements !== 'undefined'){ 679 if(typeof this.application.ninja.selectedElements !== 'undefined'){
680 this.selectionModel = this.application.ninja.selectedElements; 680 this.selectionModel = this.application.ninja.selectedElements;
681 } 681 }
682
683 this.draw3DGrid = this.application.ninja.appModel.show3dGrid;
682 } 684 }
683 }, 685 },
684 686
@@ -700,6 +702,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
700 this.application.ninja.stage._scrollLeft = this.savedTopScroll; 702 this.application.ninja.stage._scrollLeft = this.savedTopScroll;
701 } 703 }
702 this.application.ninja.stage.handleScroll(); 704 this.application.ninja.stage.handleScroll();
705
706 this.application.ninja.appModel.show3dGrid = this.draw3DGrid;
703 } 707 }
704 } 708 }
705 //////////////////////////////////////////////////////////////////// 709 ////////////////////////////////////////////////////////////////////
diff --git a/js/helper-classes/RDGE/GLCircle.js b/js/helper-classes/RDGE/GLCircle.js
index 712544c0..15ed6b6d 100755
--- a/js/helper-classes/RDGE/GLCircle.js
+++ b/js/helper-classes/RDGE/GLCircle.js
@@ -47,8 +47,8 @@ function GLCircle()
47 47
48 this._strokeWidth = strokeSize; 48 this._strokeWidth = strokeSize;
49 this._innerRadius = innerRadius; 49 this._innerRadius = innerRadius;
50 this._strokeColor = strokeColor; 50 if (strokeColor) this._strokeColor = strokeColor;
51 this._fillColor = fillColor; 51 if (fillColor) this._fillColor = fillColor;
52 52
53 this._strokeStyle = strokeStyle; 53 this._strokeStyle = strokeStyle;
54 } 54 }
@@ -398,59 +398,58 @@ function GLCircle()
398 // set up the fill style 398 // set up the fill style
399 ctx.beginPath(); 399 ctx.beginPath();
400 ctx.lineWidth = 0; 400 ctx.lineWidth = 0;
401 ctx.fillStyle = "#990000";
402 if (this._fillColor) 401 if (this._fillColor)
403 { 402 {
404 var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")"; 403 var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")";
405 ctx.fillStyle = c; 404 ctx.fillStyle = c;
406 }
407 405
408 // draw the fill 406 // draw the fill
409 ctx.beginPath(); 407 ctx.beginPath();
410 var p = MathUtils.transformPoint( bezPts[0], mat ); 408 var p = MathUtils.transformPoint( bezPts[0], mat );
411 ctx.moveTo( p[0], p[1] ); 409 ctx.moveTo( p[0], p[1] );
412 var index = 1; 410 var index = 1;
413 while (index < n) 411 while (index < n)
414 { 412 {
415 p0 = MathUtils.transformPoint( bezPts[index], mat ); 413 p0 = MathUtils.transformPoint( bezPts[index], mat );
416 p1 = MathUtils.transformPoint( bezPts[index+1], mat ); 414 p1 = MathUtils.transformPoint( bezPts[index+1], mat );
417 415
418 x0 = p0[0]; y0 = p0[1]; 416 x0 = p0[0]; y0 = p0[1];
419 x1 = p1[0]; y1 = p1[1]; 417 x1 = p1[0]; y1 = p1[1];
420 ctx.quadraticCurveTo( x0, y0, x1, y1 ); 418 ctx.quadraticCurveTo( x0, y0, x1, y1 );
421 index += 2; 419 index += 2;
422 } 420 }
423 421
424 if ( MathUtils.fpSign(innerRad) > 0) 422 if ( MathUtils.fpSign(innerRad) > 0)
425 {
426 xScale = 0.5*innerRad*this._width;
427 yScale = 0.5*innerRad*this._height;
428 mat[0] = xScale;
429 mat[5] = yScale;
430
431 // get the bezier points
432 var bezPts = MathUtils.circularArcToBezier( Vector.create([0,0,0]), Vector.create([1,0,0]), -2.0*Math.PI );
433 if (bezPts)
434 { 423 {
435 var n = bezPts.length; 424 xScale = 0.5*innerRad*this._width;
436 p = MathUtils.transformPoint( bezPts[0], mat ); 425 yScale = 0.5*innerRad*this._height;
437 ctx.moveTo( p[0], p[1] ); 426 mat[0] = xScale;
438 index = 1; 427 mat[5] = yScale;
439 while (index < n) 428
429 // get the bezier points
430 var bezPts = MathUtils.circularArcToBezier( Vector.create([0,0,0]), Vector.create([1,0,0]), -2.0*Math.PI );
431 if (bezPts)
440 { 432 {
441 p0 = MathUtils.transformPoint( bezPts[index], mat ); 433 var n = bezPts.length;
442 p1 = MathUtils.transformPoint( bezPts[index+1], mat ); 434 p = MathUtils.transformPoint( bezPts[0], mat );
443 435 ctx.moveTo( p[0], p[1] );
444 var x0 = p0[0], y0 = p0[1], 436 index = 1;
445 x1 = p1[0], y1 = p1[1]; 437 while (index < n)
446 ctx.quadraticCurveTo( x0, y0, x1, y1 ); 438 {
447 index += 2; 439 p0 = MathUtils.transformPoint( bezPts[index], mat );
440 p1 = MathUtils.transformPoint( bezPts[index+1], mat );
441
442 var x0 = p0[0], y0 = p0[1],
443 x1 = p1[0], y1 = p1[1];
444 ctx.quadraticCurveTo( x0, y0, x1, y1 );
445 index += 2;
446 }
448 } 447 }
449 } 448 }
450 }
451 449
452 // fill the path 450 // fill the path
453 ctx.fill(); 451 ctx.fill();
452 }
454 453
455 // calculate the stroke matrix 454 // calculate the stroke matrix
456 xScale = 0.5*this._width - 0.5*lineWidth; 455 xScale = 0.5*this._width - 0.5*lineWidth;
@@ -461,35 +460,10 @@ function GLCircle()
461 // set up the stroke style 460 // set up the stroke style
462 ctx.beginPath(); 461 ctx.beginPath();
463 ctx.lineWidth = lineWidth; 462 ctx.lineWidth = lineWidth;
464 ctx.strokeStyle = "#0000ff";