From f57727d36709bbda03b45788dc12faf31a591b40 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 24 Apr 2012 08:28:39 -0700 Subject: re-compute and store the center of the subpath in local coordinates upon file open --- js/tools/PenTool.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/tools') diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 4ff77371..8ecc9f79 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -786,7 +786,8 @@ exports.PenTool = Montage.create(ShapeTool, { glmat4.multiply( newMat, tMat, newMat); this._selectedSubpathPlaneMat = newMat; ViewUtils.setMatrixForElement(this._selectedSubpathCanvas, newMat, true); - + + //now set the center of the canvas as the center of the bounding box expressed in stage world coordinates var localToStageWorldMat = ViewUtils.getLocalToStageWorldMatrix(this._selectedSubpathCanvas, false, false); this._selectedSubpathCanvasCenter = MathUtils.transformAndDivideHomogeneousPoint(bboxMid, localToStageWorldMat); this._selectedSubpathCanvasCenter[0]+= xAdjustment; -- cgit v1.2.3