You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Manu Cornet <ma...@gmail.com> on 2008/08/12 06:53:26 UTC

getBBox before transcoding?

Hi everyone,

[Gogole did not help me, if this is a really dumb question please tell
me where I should rtfm :-) ]

I'm trying to flip an element horizontally ("mirror"), and a standard
SVG 'transform="scale(-1,1)"' attribute would work great, but I would
like to avoid modifying the object's coordinates (currently its x
obvsiouly becomes -x).

I tried casting the element into an SVGLocatable, but since I'm doing
this before doing any rendering (at the end I am transcoding the SVG
to a bitmap) the getBBox returns null, as expected I guess.

Do you guys know any easy workaround for this (apart from hardcoding
the X and Y in the SVG and using translate)? Is there, say, a way to
do some kind of a dummy rendering of the SVG just to get the bouding
boxes right?

I will obviously be happy to post any extra information if it's needed :-)

Thanks a lot for your answers!!
Manu

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


Re: getBBox before transcoding?

Posted by Manu Cornet <ma...@gmail.com>.
As I was looking for a Batik IRC channel, a nice guy on #svg gave me
an answer on this (putting it here for the archives, not sure how the
IRC logs are accessed), it looks like

    http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom

has exactly what I need (to build the tree before I try using any real
feature of the SVG DOM).

Thanks!
Manu

On Tue, Aug 12, 2008 at 1:53 PM, Manu Cornet <ma...@gmail.com> wrote:
> Hi everyone,
>
> [Gogole did not help me, if this is a really dumb question please tell
> me where I should rtfm :-) ]
>
> I'm trying to flip an element horizontally ("mirror"), and a standard
> SVG 'transform="scale(-1,1)"' attribute would work great, but I would
> like to avoid modifying the object's coordinates (currently its x
> obvsiouly becomes -x).
>
> I tried casting the element into an SVGLocatable, but since I'm doing
> this before doing any rendering (at the end I am transcoding the SVG
> to a bitmap) the getBBox returns null, as expected I guess.
>
> Do you guys know any easy workaround for this (apart from hardcoding
> the X and Y in the SVG and using translate)? Is there, say, a way to
> do some kind of a dummy rendering of the SVG just to get the bouding
> boxes right?
>
> I will obviously be happy to post any extra information if it's needed :-)
>
> Thanks a lot for your answers!!
> Manu
>

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