You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2009/02/17 19:17:46 UTC

DO NOT REPLY [Bug 46721] Bug in SVGFeOffsetElementBridge when using primitiveUnits="objectBoundingBox" -- Wrong Translation

https://issues.apache.org/bugzilla/show_bug.cgi?id=46721





--- Comment #1 from Eric Amram <am...@free.fr>  2009-02-17 10:17:45 PST ---
Patch that works for me (to be checked !!) :

                float dx = convertNumber(filterElement, SVG_DX_ATTRIBUTE, 0,
ctx);
                float dy = convertNumber(filterElement, SVG_DY_ATTRIBUTE, 0,
ctx);

                //
-------------------------------------------------------------
                // ERIC'S PATCH for <filter primitiveUnits="objectBoundingBox"
>
                // 'primitiveUnits' - default is userSpaceOnUse
                String units = "";
                if ( filterElement != null && filterElement.getParentNode() !=
null ) {
                        units = SVGUtilities.getChainableAttributeNS(
(Element)filterElement.getParentNode(), null, SVG_PRIMITIVE_UNITS_ATTRIBUTE,
ctx );
                }
                if ( SVG_OBJECT_BOUNDING_BOX_VALUE.equals(units) )
                {
                        // Here we are, correct, the shot!
                        dx *= filteredNode.getGeometryBounds().getWidth();
                        dy *= filteredNode.getGeometryBounds().getHeight();
                }

                //
-------------------------------------------------------------
                AffineTransform at = AffineTransform.getTranslateInstance(dx,
dy);


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org