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 Danny Ayers <da...@virgilio.it> on 2002/04/13 22:59:26 UTC

SVGGraphics2D & wonderpaths

Hi,

Sorry if I'm missing something obvious here (it's been a 13hr session), but
my code seems to have found a wonderfully awful algorithm for converting
from a simple GeneralPath into a <path/>.

The Java2D code goes like this :

path.moveTo(x - CROSS_WIDTH / 2, y - CROSS_HEIGHT / 2); // top left
path.lineTo(x + CROSS_WIDTH / 2, y + CROSS_HEIGHT / 2); // bottom right
path.moveTo(x - CROSS_WIDTH / 2, y + CROSS_HEIGHT / 2); // bottom left
path.lineTo(x + CROSS_WIDTH / 2, y - CROSS_HEIGHT / 2); // top right

An example of the SVG generated through SVGGraphics2D is at
http://www.isacat.net/svg/verbose.svg

Suggestions on general ways of getting this sensible and/or pointers to
related docs would be appreciated - e.g. am I still liable to get this stuff
using a couple of Line2Ds instead?

Cheers,
Danny.

---
Danny Ayers
<stuff> http://www.isacat.net </stuff>


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


RE: SVGGraphics2D & wonderpaths

Posted by Danny Ayers <da...@virgilio.it>.
>Could you tell me what you call exactly on Graphics2D and how it differs
>from the code I attached?

The code I'm using draws the cross & some text on a container - I'll try and
reproduce things using your code.


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


Re: SVGGraphics2D & wonderpaths

Posted by Vincent Hardy <vi...@sun.com>.
Danny,

I have tried to reproduce the bug you report but with no success (see
the attached test file and corresponding SVG when using the Batik 
SVG Generator test infrastructure). 

Could you tell me what you call exactly on Graphics2D and how it differs
from the code I attached?

Vincent.

Danny Ayers wrote:
> 
> Hi,
> 
> Sorry if I'm missing something obvious here (it's been a 13hr session), but
> my code seems to have found a wonderfully awful algorithm for converting
> from a simple GeneralPath into a <path/>.
> 
> The Java2D code goes like this :
> 
> path.moveTo(x - CROSS_WIDTH / 2, y - CROSS_HEIGHT / 2); // top left
> path.lineTo(x + CROSS_WIDTH / 2, y + CROSS_HEIGHT / 2); // bottom right
> path.moveTo(x - CROSS_WIDTH / 2, y + CROSS_HEIGHT / 2); // bottom left
> path.lineTo(x + CROSS_WIDTH / 2, y - CROSS_HEIGHT / 2); // top right
> 
> An example of the SVG generated through SVGGraphics2D is at
> http://www.isacat.net/svg/verbose.svg
> 
> Suggestions on general ways of getting this sensible and/or pointers to
> related docs would be appreciated - e.g. am I still liable to get this stuff
> using a couple of Line2Ds instead?
> 
> Cheers,
> Danny.
> 
> ---
> Danny Ayers
> <stuff> http://www.isacat.net </stuff>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org