diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 3f4b940d..4cf068ef 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -757,6 +757,8 @@ function svg_edit_setup() { ['shift+right', function(){rotateSelected(1)}], ['shift+O', selectPrev], ['shift+P', selectNext], + ['ctrl+up', function(evt){clickZoom(true);evt.preventDefault();}], + ['ctrl+down', function(evt){clickZoom();evt.preventDefault();}], ['+', function(evt){clickZoom(true);evt.preventDefault();}], ['-', function(evt){clickZoom();evt.preventDefault();}], ['up', function(evt){moveSelected(0,-1);evt.preventDefault();}], diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index ba3c289a..c5c1f794 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1031,6 +1031,24 @@ function BatchCommand(text) { if (child.nodeType == 1) { var childBox = child.getBBox(); if (childBox) { + // TODO: to fix the rotation problem, we must account for the + // child's rotation in the bbox adjustment + + // If the child is rotated at all, we should figure out the rotated + // bbox before the group's transform, remap all four corners of the bbox + // via the group's transform, then determine the new angle and the new center + /* + var childAngle = canvas.getRotationAngle(child) * Math.PI / 180.0; + var left = childBox.x - gcx, + top = childBox.y - gcy, + right = childBox.x + childBox.width - gcx, + bottom = childBox.y + childBox.height - gcy; + + var ptTopLeft = remap(left,top), + ptTopRight = remap(right,top), + ptBottomLeft = remap(left,bottom), + ptBottomRight = remap(right,bottom); + */ var pt = remap(childBox.x,childBox.y), w = scalew(childBox.width), h = scaleh(childBox.height);