a few issues with paintops : bristle and speed

Bart Coppens kde at bartcoppens.be
Mon Mar 12 18:32:27 CET 2007


On Monday 12 March 2007 17:45, Cyrille Berger wrote:
> == speed sensors ==
> One of the component of dynamic paintop are sensors, it's just the name I
> gave to pressure, tilt, etc.. And one of the sensor I would like to add is
> the speed of the pointer, unfortunately it's not as easy as it seems (API
> wise). As, the paintop is called by functions in KisPainter, and it
> received a KisPaintInformation, so the mouse speed should be a field of
> KisPaintInformation, but I don't find it is a good idea to add the speed of
> the mouse as a parameter to KisPainter::drawLine. What do you think ? Any
> other idea ?
I created KisPaintInformation exactly for this kind of stuff. Exchanging all 
the tilt&pressure parameters in the KisPainter::paintLine would make the 
function call look nicer, shorter, and allow us to add even more stuff later 
on if we'd need it. So I'm all for it.
The only small detail is that paintLine itself would fill in the movement 
field of the KisPaintInformation. I suggest keeping it that way, but 
documenting it. (This allows us to ensure that the movement information is 
always correct for the line drawn, and doesn't bother the tools with extra 
code to calculate it.)

Bart


More information about the kimageshop mailing list