|
…nevermind, that’s not how you
get center X/Y. Now it stays put for the most part; I’m getting random
incorrect translations that I haven’t been able to solve yet. Michael Bishop From: Bishop, Michael
W. CONTR J9C880 [mailto:[EMAIL PROTECTED] More transform issues! As you may recall, I add a
translate value to move objects around the canvas. Now I’m working
on scaling and I like the scale to be uniform around the center of
element. I get the center point by asking the Element for its bounding
box: centerX = boundingBox.getWidth() – boundingBox.getX(); centerY = boundingBox.getHeight() –
boundingBox.getY(); In the SVG Essentials book I have, it says to scale around a
center point, the translate should be set to: translate(-centerX * (factor – 1), -centerY * (factor
– 1)) Instead of setting the above, I ADD the above to the
existing translate if one exists. However, when I scale, the element
stays nowhere near the center point. I tried simply SETTING the translate
values, losing the previous ones and it’s still wrong. Is there a
better technique for scaling around the center of an element, or is my math
just wrong somewhere? Michael Bishop |
RE: Scaling around a center point...
Bishop, Michael W. CONTR J9C880 Wed, 07 Dec 2005 10:15:25 -0800
- RE: Scaling around a center point... Bishop, Michael W. CONTR J9C880
- RE: Scaling around a center point... Bishop, Michael W. CONTR J9C880
- RE: Scaling around a center point... thomas . deweese
- RE: Scaling around a center point... Bishop, Michael W. CONTR J9C880
- Re: Scaling around a center point... Archie Cobbs
- RE: Scaling around a center point... Tonny Kohar
- RE: Scaling around a center point... Bishop, Michael W. CONTR J9C880
- RE: Scaling around a center point... Bishop, Michael W. CONTR J9C880
- RE: Scaling around a center point... Bishop, Michael W. CONTR J9C880
- Re: Scaling around a center point... Archie Cobbs
- Re: Scaling around a center point... G. Wade Johnson
