W3C home > Mailing lists > Public > www-svg@w3.org > April 2008

Re: transform attribute causing problem

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Tue, 29 Apr 2008 15:20:22 +0200
To: "Eric Hamacher" <eric.hamacher@enetrix.com>
Cc: <www-svg@w3.org>
Message-ID: <ts7e149j3t0ns8f1a4rtcoa08uhlfcrca1@hive.bjoern.hoehrmann.de>

* Eric Hamacher wrote:
><g id="ida" transform="scale(3)">
>
><path id="testarrow"
>d="M283.378,80.237c-2.396,1.019-3.978,2.676-5.135,4.068c-1.373,1.65-2.82
>1,4.428-2.821,5.221
>c0,0.527,0.502,0.956,1.123,0.956c0.369,0,0.697-0.151,0.902-0.384l-0.003,
>0.001c0.212-0.246-0.212,0.246,0.529-0.608
>c1.16-1.336,4.04-3.531,8.101-5.367c4.061-1.835,8.363-2.988,10.438-3.439c
>0.779-0.168,1.261-0.29,1.621-0.443
>c0.76-0.323,1.286-0.986,1.286-1.757c0-0.771-0.524-1.438-1.286-1.758v-0.0
>01c-0.36-0.152-0.842-0.274-1.621-0.443
>c-2.074-0.451-6.377-1.604-10.438-3.439c-4.061-1.836-6.94-4.03-8.101-5.36
>7c-0.741-0.854-0.317-0.361-0.529-0.607h0.003c-0.205-0.232-0.533-0.383-0.
>902-0.383c-0.621,0-1.123,0.428-1.123,0.955c0,0.794,1.448,3.57,2.821,5.22
>1
>c1.156,1.391,2.745,3.022,5.124,4.065c0.756,0.331,1.287,0.986,1.287,1.758
>C284.654,79.255,284.138,79.913,283.378,80.237z">
>
></path>
>
></g>

As an aside, I would recommend to post samples to a separate site, such
as one of the many pastebin services or the www-archive mailing list, to
avoid issues like we have here, you wrapped the path data in the middle
of numbers, making the whole d attribute malformed.

>The path will not print.  When the 'transform="scale(3)"' is taken out,
>the path shows up.  I am using Batik 1.7 but is that what is causing the
>problem? 

The transformation does not scale the item e.g. using the middle of the
bounding box as center, so unless you position it around 0,0, scaling
will also shift it, and in your case probably shift it out of view. You
have to move it back into view. You could use e.g. scripting to find out
where it ends up, or use <animateTransform> to see how it's shifting.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Tuesday, 29 April 2008 13:21:04 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:39 GMT