Re: [Tuxpaint-devel] Polygon fill messing with other tools drawing
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Pere P. i C. <per...@gm...> - 2024-04-09 07:31:26
|
El dl. 08 de 04 de 2024 a les 21:06 -0700, en/na Bill Kendrick va escriure: > On Sun, Apr 07, 2024 at 03:11:09PM +0200, Pere Pujal i Carabantes wrote: > > Hi all, > > > > Tested the new polyfill stuff, it is nice :) > > > > Just found a minor problem: > > "Minor" X-D Well, polyfill is WIP, I don't consider bugs critical if we are not near a release :) > > > > Start Tux Paint, select the Polygon Fill tool. > > select another tool and draw something. > > Return to the Polygon Fill tool, see how everything you had drawn is lost. > > > > The problem is polyfill_snapshot being kept and later blit into the canvas via > > set_color() -> draw_preview() before switchin() > > > > We could clean up polyfill_snapshot at switchout() and recreate it at each swcithin() or > > we could set some marker, mark it at switchout, clean it up at switchin() and only blit polyfill_snapshot > > if the marker allows it, that would allow to reuse polyfill_snapshot and not destroy/recreate it > > at each switchout()/switchin() cycle. > > For now, I've set a variable to tell whether switchin() has been > called yet. To me, it seems strange that I'm calling a Magic tool's > set_color() BEFORE its switchin() has been called. But rather than > change that (and potentially break lots of other tools), I've opened a > ticket. :-) > > https://sourceforge.net/p/tuxpaint/bugs/286/ > > I also addressed an issue I already knew about, where the in-progress > polygon preview (the lines and big red & green boxes) would remain on > the canvas when switching to a different tool. Oh, I thouth it was on purpose, to let children with something painted on the screen, in fact the Undo tool still recovers them. > > I believe I solved that by simply blitting the tool's own snapshot > back to the canvas on switchout(). (And since it makes a fresh > snapshot after every polygon has been completed, this works.) > > Adjustments like this may help some of the other Magic tools that > "act weird" when you're in the middle of using them, but then > switch away. > > I've also thought it might be nice to provide a way for Magic > tools to say "I can handle the 'Undo' command myself", e.g. > for Filled Polygon tool, it would remove the most-recently > added point. Then, if there's no more work for them to do, > they can tell Tux Paint that it should do it's normal Undo > process. > > Prior to that, I also thought it might be interesting to provide a > way for Magic tools to provide an 'overlay' SDL_Surface which > Tux Paint would draw on top everything else, rather than having > to abuse the main `canvas` surface to draw previews, crosshairs, > grids, etc. > > Things are getting tricky. :) > > -bill! Currently magic tools that need multiple clicks to do their work are tricky, especially when faced to the Undo tool. Pere > |