Jamie Browning wrote:
Thanks for the pointer! This code certainly seems cleaner than mine ;-)
However it doesn't seem to have fully solved the problem. Perhaps I am
missing something above just the implementation of this function.
Again I have included my test file to show what I mean. Notice how it
works fine when preserveAspectRatio abuts the margins to the window
minimum, but is offset slightly when the document is scaled to be
centered (or right aligned) on the window.
Well I'm running with ASV 6.0beta in this case the outer SVG is
correct but the inner one is wrong. To get the inner one to work I
had to modify the function:
function getScreenCTM(elem) {
if (elem.currentScale) {
var scale = elem.currentScale;
var trans = elem.currentTranslate;
var ret = root.createSVGMatrix();
ret.scale(scale);
ret.translate(trans.x, trans.y);
return ret;
}
var pMat = getScreenCTM(elem.parentNode);
var eMat = elem.getCTM();
if (eMat == null) return pMat;
eMat = eMat.multiply(pMat);
return eMat;
}
I don't know if this will fix it for ASV 3.0 (I tend to doubt it).
It's worth noting that this depends on ASV implementing functions
from the standard incorrectly, so you really do need to bypass this
for UA's that implement the spec correctly like Batik.
In my file I attempted to implement a function getGlobalTransform - is
this required? (Why did Adobe not implement this function, Grrrr....)
I don't really know and I don't know ;)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]