aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/brush-stroke.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-07-24 15:46:16 -0700
committerJohn Mayhew2012-07-24 15:46:16 -0700
commit9f240b8b9b1f5fb0f145c343ca5e533e25e81374 (patch)
tree407564eaa6466e8d4cf2eeee0c56dc623243586f /js/lib/geom/brush-stroke.js
parentd25359c75089215ee48838db081fd3d51cbbd85f (diff)
parent21d74af1e9fc57cc25cea8aa7408beabf79ff2f3 (diff)
downloadninja-9f240b8b9b1f5fb0f145c343ca5e533e25e81374.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja
Diffstat (limited to 'js/lib/geom/brush-stroke.js')
-rwxr-xr-xjs/lib/geom/brush-stroke.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/js/lib/geom/brush-stroke.js b/js/lib/geom/brush-stroke.js
index 12f5c5a1..164d31ee 100755
--- a/js/lib/geom/brush-stroke.js
+++ b/js/lib/geom/brush-stroke.js
@@ -864,6 +864,17 @@ BrushStroke.prototype.drawToContext = function(ctx, drawStageWorldPts, stageWorl
864}; //this.drawToCanvas() 864}; //this.drawToCanvas()
865 865
866 866
867
868BrushStroke.prototype._fixCoordPrecision = function(coord, precision){
869 var i=0;
870 var numPoints = coord.length;
871 for (i=0;i<numPoints;i++){
872 coord[i][0] = parseFloat((coord[i][0]).toFixed(precision));
873 coord[i][1] = parseFloat((coord[i][1]).toFixed(precision));
874 coord[i][2] = parseFloat((coord[i][2]).toFixed(precision));
875 }
876};
877
867BrushStroke.prototype.exportJSON = function(){ 878BrushStroke.prototype.exportJSON = function(){
868 var retObject= new Object(); 879 var retObject= new Object();
869 //the type of this object 880 //the type of this object
@@ -873,9 +884,10 @@ BrushStroke.prototype.exportJSON = function(){
873 //the geometry for this object 884 //the geometry for this object
874 retObject.localPoints = this._LocalPoints.slice(0); 885 retObject.localPoints = this._LocalPoints.slice(0);
875 this._copyCoordinates3D(this._LocalPoints, retObject.localPoints); //todo is this necessary in addition to the slice(0) above? 886 this._copyCoordinates3D(this._LocalPoints, retObject.localPoints); //todo is this necessary in addition to the slice(0) above?
887 this._fixCoordPrecision(retObject.localPoints, 4);
876 retObject.origLocalPoints = this._OrigLocalPoints.slice(0); 888 retObject.origLocalPoints = this._OrigLocalPoints.slice(0);
877 this._copyCoordinates3D(this._OrigLocalPoints, retObject.origLocalPoints); //todo <ditto> 889 this._copyCoordinates3D(this._OrigLocalPoints, retObject.origLocalPoints); //todo <ditto>
878 890 this._fixCoordPrecision(retObject.origLocalPoints, 4);
879 retObject.stageWorldCenter = [this._stageWorldCenter[0],this._stageWorldCenter[1],this._stageWorldCenter[2]]; 891 retObject.stageWorldCenter = [this._stageWorldCenter[0],this._stageWorldCenter[1],this._stageWorldCenter[2]];
880 retObject.planeMat = this._planeMat; 892 retObject.planeMat = this._planeMat;
881 retObject.planeMatInv = this._planeMatInv; 893 retObject.planeMatInv = this._planeMatInv;