A snag...

Boudewijn Rempt boud at calcifer.valdyas.org
Thu Jan 8 14:50:29 CET 2004

On Thu, 8 Jan 2004, Patrick Julien wrote:

> Then I would think that so does every single other paint program.  Even if you
> install an X filter, you won't get every X mouse event.

That's very likely true. However, if you make the barest Qt app that
paints a pixel on mousemove, you get a a gappy line; interpolating
the positions gives straight line sections, and it takes time, which
makes the line even more inaccurate. Karbon now also has a pencil tool,
but it suffers from the same problem to some extent -- less than Krita,
of course, but then neither my drawing code nor the interpolation code
I copied from the old brush tool seems particularly efficient.

The Gimp doesn't seem to have any problems. You can get very accurate
lines with the Gimp. So I'm now reading the Gimp source to discover how
they manage.

I have, by the way, tested the granularity of mouse events in all
possible variations: with/without interpolation code with/without
painting, and even when I do nothing but print the mouse positions,
I don't get enough pixel positions for a line as accurate as the Gimp's.

There must be solution: I refuse to believe that it is impossible to
write a paint app in Qt that cannot produce an accurate line, even though
I have never seen one (even the Qt QPainter demo's take the shortcut of
connecting the mouse positions with straight lines.) -- and I want to
create plenty of even more complicated tools.

More information about the kimageshop mailing list