diff options
author | hwc487 | 2012-07-23 14:37:51 -0700 |
---|---|---|
committer | hwc487 | 2012-07-23 14:37:51 -0700 |
commit | e9d08c7af751d75af16371fcac06fd1af8a60fac (patch) | |
tree | e0499f795bf5a5f3db30b61e70a5852ff0799aed /js/lib/geom | |
parent | 2b05717e49bafc4b401441d9a55153b9e4ae7e43 (diff) | |
download | ninja-e9d08c7af751d75af16371fcac06fd1af8a60fac.tar.gz |
Bugs fixed:
1915 - Data.JSON too large. Reduced mesh size and limited precision of fp numbers
1381 - Background transparency in preview.
1740 - File Save As caused WebGL to stop animating. Crossed RDGE IDs
1954 - Texture change from material popup broke screen rendering. Set correct context on property change.
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-x | js/lib/geom/brush-stroke.js | 14 |
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 | |||
868 | BrushStroke.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 | |||
867 | BrushStroke.prototype.exportJSON = function(){ | 878 | BrushStroke.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; |