Hi all,

   This is a bit of a warning.  I will shortly be committing new code
that implements currentScale/Translate.  In the processes I cleaned up
and fixed several of the SVGLocatable methods dealing with
transformations (including getCTM and getScreenCTM - which is now
implemented). 

   In the processes I had to fix the values in clientX/Y in mouse events.
They had been values in the viewBox coordinate system, so any rendering
transform or viewbox transform had already been applied.  They are now
returned as viewport coordinates (i.e. pixel locations in the JSVGComponent).
Clearly viewbox values are generally more useful however because these values
are integers there are issues with viewBox attributes like "0 0 1 1"
which are common in some uses.

   Fortunately because Batik now implements getScreenCTM you have a much
better way to handle currentX/Y, that can give you accurate location 
information for any element:

    function getLocationOnElement(evt, elem) {
           mat = elem.getScreenCTM();
           imat = mat.inverse();   // Go from screen to elem
           var pt = document.rootElement.createSVGPoint();
           pt.x = evt.clientX;
           pt.y = evt.clientY;
           pt = pt.matrixTransform(imat);
           return pt;
    }

  As part of these changes I also modified the bootstrap proceedure in
JSVGComponent.  In the past it would requests a new size and
immediately start a rendering, with the old size.  This rendering
would usually be cancelled by the resize event.  Now the JSVGComponent
attempts to find it's Window (by calling getParent) and call pack() on
it to force a relayout so it can determine it's new size before
calling onload scripts. In cases where it can't find it's Window it
should behave exactly the same as it always has (with two renderings).

   There have also been some minor interface changes on some
"internal" JSVGComponent methods (updateTransform, computeTransform).
So developers who have modified pieces of Batik may want to be a bit
careful before doing a CVS update.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to