[Grace-core] Cross platform graphics library

James Noble kjx at ecs.vuw.ac.nz
Tue Jan 28 13:49:05 PST 2014


> Yeah it's a good point, I thought about it for a while. It felt like there would be too much duplicate code if I had drawXX methods and fillXX methods on the canvas,
> because they would be identical apart from draw would set the fill flag in the Drawable to false. 
> But it probably would make more sense two have both sets of methods, and not have the flag on the canvas. That's how Java does it.

well another option is to put the flag on the method. but that doesn't feel great either.
(the **generalised method extension** would be another way to fix this, but it's a big fix :-)

> I mean, what does canvas.fill := false actually mean :P 
> Feels a bit ambiguous thinking about it now

it's odd that's that the only bit of state.
putting fill or colour into a graphics context object seems fine, but on the canvas is odd

J


More information about the Grace-core mailing list