aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--images/cursors/penCursors/Pen_.pngbin0 -> 182 bytes
-rw-r--r--images/cursors/penCursors/Pen_anchorSelect.pngbin0 -> 268 bytes
-rw-r--r--images/cursors/penCursors/Pen_append.pngbin0 -> 210 bytes
-rw-r--r--images/cursors/penCursors/Pen_closePath.pngbin0 -> 211 bytes
-rw-r--r--images/cursors/penCursors/Pen_minus.pngbin0 -> 204 bytes
-rw-r--r--images/cursors/penCursors/Pen_newPath.pngbin0 -> 215 bytes
-rw-r--r--images/cursors/penCursors/Pen_plus.pngbin0 -> 211 bytes
-rw-r--r--images/cursors/penCursors/penAdd_OLD.png (renamed from images/cursors/penAdd.png)bin3043 -> 3043 bytes
-rwxr-xr-xjs/components/tools-properties/brush-properties.reel/brush-properties.html2
-rwxr-xr-xjs/components/tools-properties/pen-properties.reel/pen-properties.html2
-rwxr-xr-xjs/document/html-document.js4
-rwxr-xr-xjs/helper-classes/3D/vec-utils.js19
-rwxr-xr-xjs/helper-classes/3D/view-utils.js85
-rwxr-xr-xjs/lib/drawing/world.js7
-rwxr-xr-xjs/lib/geom/anchor-point.js4
-rwxr-xr-xjs/lib/geom/brush-stroke.js16
-rwxr-xr-xjs/lib/geom/sub-path.js853
-rw-r--r--js/tools/BrushTool.js1
-rwxr-xr-xjs/tools/PenTool.js1256
-rwxr-xr-xjs/tools/drawing-tool-base.js2
20 files changed, 1190 insertions, 1061 deletions
diff --git a/images/cursors/penCursors/Pen_.png b/images/cursors/penCursors/Pen_.png
new file mode 100644
index 00000000..fea41116
--- /dev/null
+++ b/images/cursors/penCursors/Pen_.png
Binary files differ
diff --git a/images/cursors/penCursors/Pen_anchorSelect.png b/images/cursors/penCursors/Pen_anchorSelect.png
new file mode 100644
index 00000000..c05c2312
--- /dev/null
+++ b/images/cursors/penCursors/Pen_anchorSelect.png
Binary files differ
diff --git a/images/cursors/penCursors/Pen_append.png b/images/cursors/penCursors/Pen_append.png
new file mode 100644
index 00000000..1dbb959f
--- /dev/null
+++ b/images/cursors/penCursors/Pen_append.png
Binary files differ
diff --git a/images/cursors/penCursors/Pen_closePath.png b/images/cursors/penCursors/Pen_closePath.png
new file mode 100644
index 00000000..8447ddbc
--- /dev/null
+++ b/images/cursors/penCursors/Pen_closePath.png
Binary files differ
diff --git a/images/cursors/penCursors/Pen_minus.png b/images/cursors/penCursors/Pen_minus.png
new file mode 100644
index 00000000..41fe47d8
--- /dev/null
+++ b/images/cursors/penCursors/Pen_minus.png
Binary files differ
diff --git a/images/cursors/penCursors/Pen_newPath.png b/images/cursors/penCursors/Pen_newPath.png
new file mode 100644
index 00000000..547731f3
--- /dev/null
+++ b/images/cursors/penCursors/Pen_newPath.png
Binary files differ
diff --git a/images/cursors/penCursors/Pen_plus.png b/images/cursors/penCursors/Pen_plus.png
new file mode 100644
index 00000000..192c71fe
--- /dev/null
+++ b/images/cursors/penCursors/Pen_plus.png
Binary files differ
diff --git a/images/cursors/penAdd.png b/images/cursors/penCursors/penAdd_OLD.png
index c306cc85..c306cc85 100644
--- a/images/cursors/penAdd.png
+++ b/images/cursors/penCursors/penAdd_OLD.png
Binary files differ
diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.html b/js/components/tools-properties/brush-properties.reel/brush-properties.html
index 98442164..d9c35dc2 100755
--- a/js/components/tools-properties/brush-properties.reel/brush-properties.html
+++ b/js/components/tools-properties/brush-properties.reel/brush-properties.html
@@ -84,7 +84,7 @@
84 </head> 84 </head>
85 85
86 <body> 86 <body>
87 <div id="brushProperties" class="subToolHolderPanel"> 87 <div data-montage-id="brushProperties" class="subToolHolderPanel">
88 <div id="strokesContainer" class="leftLabel" style="margin-left:25px; padding-top: 3px;"> 88 <div id="strokesContainer" class="leftLabel" style="margin-left:25px; padding-top: 3px;">
89 <label class="label"> Width:</label> 89 <label class="label"> Width:</label>
90 <div id="strokeSize" class="label"></div> 90 <div id="strokeSize" class="label"></div>
diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.html b/js/components/tools-properties/pen-properties.reel/pen-properties.html
index 74a3a747..acbedcac 100755
--- a/js/components/tools-properties/pen-properties.reel/pen-properties.html
+++ b/js/components/tools-properties/pen-properties.reel/pen-properties.html
@@ -39,7 +39,7 @@
39 </head> 39 </head>
40 40
41 <body> 41 <body>
42 <div id="penProperties" class="subToolHolderPanel"> 42 <div data-montage-id="penProperties" class="subToolHolderPanel">
43 <div id="strokesContainer" class="leftLabel" style="margin-left:25px; padding-top: 3px;"> 43 <div id="strokesContainer" class="leftLabel" style="margin-left:25px; padding-top: 3px;">
44 <label class="label"> Stroke:</label> 44 <label class="label"> Stroke:</label>
45 <div id="strokeSize" class="label"></div> 45 <div id="strokeSize" class="label"></div>
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 54db9eaa..3876670c 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -330,6 +330,10 @@ exports.HTMLDocument = Montage.create(TextDocument, {
330 elementModel.pi = "BrushStrokePi"; 330 elementModel.pi = "BrushStrokePi";
331 break; 331 break;
332 332
333 case root.GEOM_TYPE_CUBIC_BEZIER:
334 elementModel.selection = "Subpath";
335 elementModel.pi = "SubpathPi";
336 break;
333 337
334 default: 338 default:
335 console.log( "geometry type not supported for file I/O, " + root.geomType()); 339 console.log( "geometry type not supported for file I/O, " + root.geomType());
diff --git a/js/helper-classes/3D/vec-utils.js b/js/helper-classes/3D/vec-utils.js
index 4eacd856..0916c840 100755
--- a/js/helper-classes/3D/vec-utils.js
+++ b/js/helper-classes/3D/vec-utils.js
@@ -113,6 +113,25 @@ var VecUtils = exports.VecUtils = Object.create(Object.prototype,
113 } 113 }
114 }, 114 },
115 115
116 vecDistSq : {
117 value: function( dimen, a, b ) {
118 var sum;
119
120 if ((a.length < dimen) || (b.length < dimen))
121 {
122 throw new Error( "dimension error in VecUtils.vecDistSq" );
123 }
124
125 var sum = 0.0;
126 for (var i=0; i<dimen; i++)
127 {
128 var d = a[i] - b[i];
129 sum += d*d;
130 }
131 return sum;
132 }
133 },
134
116 vecDot : { 135 vecDot : {
117 value: function( dimen, v0, v1 ) { 136 value: function( dimen, v0, v1 ) {
118 if ((v0.length < dimen) || (v1.length < dimen)) 137 if ((v0.length < dimen) || (v1.length < dimen))
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js
index ee822f1f..40a19b90 100755
--- a/js/helper-classes/3D/view-utils.js
+++ b/js/helper-classes/3D/view-utils.js
@@ -246,7 +246,6 @@ exports.ViewUtils = Montage.create(Component, {
246 var worldPt = MathUtils.transformPoint( viewPt, mat ); 246 var worldPt = MathUtils.transformPoint( viewPt, mat );
247 var stageWorldPt = this.postViewToStageWorld( worldPt, elt ); 247 var stageWorldPt = this.postViewToStageWorld( worldPt, elt );
248 this.popViewportObj(); 248 this.popViewportObj();
249
250 return stageWorldPt; 249 return stageWorldPt;
251 } 250 }
252 }, 251 },
@@ -841,43 +840,21 @@ exports.ViewUtils = Montage.create(Component, {
841 }, 840 },
842 841
843 getStageWorldToGlobalMatrix: 842 getStageWorldToGlobalMatrix:
844 { 843 {
845 value: function() 844 value: function()
846 { 845 {
847 var stage = this.application.ninja.currentDocument.documentRoot; 846 var stage = this.application.ninja.currentDocument.documentRoot;
848 //projMat;
849
850 // get the matrix to the parent
851 //var mat = Matrix.I(4);
852 847
853 this.pushViewportObj( stage ); 848 this.pushViewportObj( stage );
849 // put the point into screen space of the stage - requires
850 // a translation to the top/left only
854 var cop = this.getCenterOfProjection(); 851 var cop = this.getCenterOfProjection();
855 var v2s = Matrix.Translation([cop[0], cop[1], 0]); 852 var v2s = Matrix.Translation([cop[0], cop[1], 0]);
856 this.popViewportObj(); 853 this.popViewportObj();
857 854
858 /* 855 // append the localToGlobal matrix of the stage.
859 var p = this.getPerspectiveDistFromElement(stage);
860 if(p)
861 {
862 projMat = glmat4.scale( Matrix.I(4), [p,p,p], [] );
863 projMat[11] = -1;
864 }
865 else
866 {
867 mat = v2s;
868 }
869 // offset to the parent
870 var offset = this.getElementOffset( stage );
871 var offMat = Matrix.Translation([offset[0], offset[1], 0]);
872 //mat = offMat.multiply( mat );
873 glmat4.multiply( offMat, mat, mat );
874 this.popViewportObj();
875 */
876
877 // append the localToGlobal matrix of the stage.
878 var mat = this.getLocalToGlobalMatrix( stage ); 856 var mat = this.getLocalToGlobalMatrix( stage );
879 glmat4.multiply( mat, v2s ); 857 glmat4.multiply( mat, v2s );
880
881 return mat; 858 return mat;
882 } 859 }
883 }, 860 },
@@ -1056,6 +1033,56 @@ exports.ViewUtils = Montage.create(Component, {
1056 } 1033 }
1057 }, 1034 },
1058 1035
1036 getLocalToStageWorldMatrix: {
1037 value: function( elt, shouldProject, shouldLocalTransform ) {
1038 var mat = Matrix.I(4);
1039 while (elt)
1040 {
1041 this.pushViewportObj( elt );
1042 var cop = this.getCenterOfProjection();
1043 var s2v = Matrix.Translation([-cop[0], -cop[1], 0]);
1044 var objMat = this.getMatrixFromElement( elt );
1045 var projMat;
1046 if(shouldProject)
1047 {
1048 //projMat = Matrix.I(4).multiply( this.getPerspectiveDistFromElement(elt) );
1049 var pDist = this.getPerspectiveDistFromElement(elt);
1050 var projMat = glmat4.scale(Matrix.I(4), [pDist,pDist,pDist], []);
1051 projMat[11] = -1;
1052 projMat[15] = 1400;
1053 }
1054 var v2s = Matrix.Translation([cop[0], cop[1], 0]);
1055 this.popViewportObj();
1056
1057 // multiply all the matrices together
1058 //mat = s2v.multiply( mat );
1059 glmat4.multiply( s2v, mat, mat );
1060 if (elt === this._stageElement) break;
1061 //mat = objMat.multiply( mat );
1062 if (shouldLocalTransform) {
1063 glmat4.multiply( objMat, mat, mat );
1064 }
1065 if(shouldProject)
1066 {
1067 //mat = projMat.multiply( mat );
1068 glmat4.multiply( projMat, mat, mat );
1069 }
1070 //mat = v2s.multiply( mat );