Login | Register
My pages Projects Community openCollabNet

Discussions > issues > [gef-issues] [Issue 252] Convert SVGWriter to extend Graphics2D

Discussion topic

Back to topic list

[gef-issues] [Issue 252] Convert SVGWriter to extend Graphics2D


Author tfmorris
Full name Tom Morris
Date 2009-09-30 13:57:20 PDT
Message http://gef.tigris.or​g/issues/show_bug.cg​i?id=252

------- Additional comments from tfmorris at tigris dot org Wed Sep 30 13:57:19 -0700 2009 -------
After I wrote that, I pretty much came to the conclusion that the right thing to
do is to stick as closely as possible to the model used by the underlying
graphics subsystem (Graphics2D). Using a different model is just more mental
work for the programmer, creating more potential for bugs.

The other reason to do this is that it meshes more naturally with the way
gradients, patterns, etc are defined. If you start using wide lines,
transparency, etc things will look better. Also Graphics2D uses floating point
coordinates, so it's not like you can count pixels and get things to butt up
against each other like in the AWT model. It's better draw the fill and the
borders using precisely the same coordinates and let the system take care of
lining them up.

The Graphics2D model is that lines are centered on an infinitely thin line drawn
through the floating point coordinates. The Graphics model is that lines are
one physical pixel wide and integer coordinate grid is located between pixels.
GEF and/or ArgoUML extends this to draw wide lines, but it wasn't clear to me
exactly how and I never saw it documented anywhere.

If the scheme described by Michiel is used consistently throughout GEF, I'd
start by documenting that and then figure out how to adapt it to the Graphics2D

« Previous message in topic | 1 of 1 | Next message in topic »


Show all messages in topic

[gef-issues] [Issue 252] Convert SVGWriter to extend Graphics2D tfmorris Tom Morris 2009-09-30 13:57:20 PDT
Messages per page: