On Sun, Jan 20, 2013 at 09:28:19PM +0100, Jon Nordby wrote:
> Also, I _believe_ that the correct thing to do is to new_stroke() on
> button/tablet down to start a stroke, then reset() on button/tablet up
> to finish it.
> Martin, does that sound right? If so, perhaps we should rename reset()
> to end_stroke()?

No! Not at all. The intention is that you feed all motion events into
brushlib, and never explicitely start or end a stroke.

I made it that way for wacom tablets, of course, which can sense motion even
when you hover a bit above the surface.  Some things won't work if you
cannot get motion events between the strokes.  MyPaint doesn't like such
devices at all, see https://gna.org/bugs/?13622 (ghost lines) for details.

Of course, when you have such a device, you need such workarounds. If
anything, we should add more explicit support for the required workarounds
and clearly document what problems that they introduce, and why you should
try hard to avoid them if you can.

When you call reset(), then you reset the state of the motion and direction
filters (and probably others, too).  This will cause the brush to forget in
what direction you were moving and how fast.  The next motion event will
"completely surprise" you.

This is quite bad, especially at the start of a stroke, when you e.g. have a
flat brush that follows your motion direction - it will not know what
direction to start with.  You can only hope that the user doesn't increase
pressure too fast, so you have a chance to initialize the direction filter
before the brush dabs start becoming opaque.  (Or you start with a round
brush dab instead of an elliptical ones. I think most brushes react to an
uncertain direction that way.)

Also, there are (were?) some brushes that make heavy use of the "gross speed
filter" with a very large time constant, to change the radius when you
linger in the same area (e.g to work on details), but slow enough that you
have time to notice the change as it happens.

For example, such a brush allows you to change the radius temporariliy, for
couple of seconds, just by hovering forth and back with the stylus and then
painting.  If you call reset() before every stroke, well, you have a
completely different brush, because every stroke starts by assuming that you
were holding the pen completely still during the last 5 minutes.

-- 
Martin Renold

_______________________________________________
Mypaint-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-discuss

Reply via email to