aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom
diff options
context:
space:
mode:
authorPushkar Joshi2012-04-24 08:28:39 -0700
committerPushkar Joshi2012-04-24 08:28:39 -0700
commitf57727d36709bbda03b45788dc12faf31a591b40 (patch)
tree16e5b0341476517c7bb1db9603d2b6cbc97dc5ee /js/lib/geom
parent5da51344c4abf53b4a77bbd4eefbea5ec67f1643 (diff)
downloadninja-f57727d36709bbda03b45788dc12faf31a591b40.tar.gz
re-compute and store the center of the subpath in local coordinates upon file open
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-xjs/lib/geom/sub-path.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js
index 43420bc9..56c94df3 100755
--- a/js/lib/geom/sub-path.js
+++ b/js/lib/geom/sub-path.js
@@ -1106,6 +1106,14 @@ GLSubpath.prototype.importJSON = function(jo) {
1106 this._fillColor = jo.fillColor; 1106 this._fillColor = jo.fillColor;
1107 1107
1108 this._dirty = true; 1108 this._dirty = true;
1109 this.createSamples(false);
1110 this.offsetPerBBoxMin();
1111
1112 //compute and store the center of the bbox in local space
1113 var bboxMin = this.getBBoxMin();
1114 var bboxMax = this.getBBoxMax();
1115 var bboxMid = [0.5*(bboxMin[0]+bboxMax[0]),0.5*(bboxMin[1]+bboxMax[1]),0.5*(bboxMin[2]+bboxMax[2])];
1116 this.setCanvasCenterLocalCoord(bboxMid);
1109}; 1117};
1110 1118
1111GLSubpath.prototype.import = function( importStr ) { 1119GLSubpath.prototype.import = function( importStr ) {