From 9c249d4ee169201dd838dc92ae78447705062dbe Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sun, 13 Dec 2009 06:42:59 +0000 Subject: [PATCH] fixtransforms branch: groups with skewed children now have correct selector boxes git-svn-id: http://svg-edit.googlecode.com/svn/branches/fixtransforms@1036 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 8bcb352f..a703aa54 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -11,9 +11,10 @@ /* TODOs for TransformList: - * go through Selector.resize() and make sure groups account for rotated/skewed children * go through Selector.resize() and rework so that they are always rectangular * go through ungrouping again + * ensure zooming works properly + * ensure undo/redo works perfectly */ /* TODOs for Localizing: @@ -5727,6 +5728,9 @@ function BatchCommand(text) { if(!elems.length) return false; // Make sure the expected BBox is returned if the element is a group + // FIXME: doesn't this mean that every time we call getStrokedBBox() that we are + // re-creating the getCheckedBBox() function? shouldn't we make this a function + // at the 'canvas' level var getCheckedBBox = function(elem) { try { // TODO: Fix issue with rotated groups. Currently they work @@ -5735,7 +5739,7 @@ function BatchCommand(text) { var bb = elem.getBBox(); var angle = canvas.getRotationAngle(elem); - if (angle && angle % 90) { + if ((angle && angle % 90) || hasMatrixTransform(canvas.getTransformList(elem))) { // Accurate way to get BBox of rotated element in Firefox: // Put element in group and get its BBox @@ -5819,6 +5823,7 @@ function BatchCommand(text) { var min_x = full_bb.x; var min_y = full_bb.y; + // FIXME: same re-creation problem with this function as getCheckedBBox() above var getOffset = function(elem) { var sw = elem.getAttribute("stroke-width"); var offset = 0;