Diagnosing a tablet headache (QT bug?)
Boudewijn Rempt
boud at valdyas.org
Sat Feb 14 14:37:50 CET 2009
On Saturday 14 February 2009, Brendon Higgins wrote:
> Hi list,
>
> I'm very much looking forward to a usable Krita 2. It's sounding very
> promising.
>
> I'm trying to work out why the Krita 2 betas and my tablet don't seem to
> get along,
That is strange... I haven't had problems with my tablet (intuos and a built-
in wacom on my tablet pc), at least not with the ordinary brush paintop. What
tablet are you using? And if it is a wacom, which version of the wacom
software?
> and I think I've narrowed it down to these lines of code:
>
> qreal subpixelX = e->hiResGlobalX();
> subpixelX = subpixelX - ((int) subpixelX); // leave only part behind the
> dot qreal subpixelY = e->hiResGlobalY();
> subpixelY = subpixelY - ((int) subpixelY); // leave only part behind the
> dot QPointF pos(e->x() + subpixelX + m_d->documentOffset.x(), e->y() +
> subpixelY + m_d->documentOffset.y());
>
> They appear in kis_qpainter_canvas.cpp and kis_opengl_canvas2.cpp. I
> whipped up a little PyQT app to test if QT was actually reporting my tablet
> events properly. It seems that hiResGlobal functions work correctly, in
> that they report screen-pixel positions with beyond-integer accuracy.
> However, x() and y() functions seem to report raw tablet X/Y data (i.e.
> points can go up well into the thousands). I believe this is what messes up
> Krita's calculations.
>
> Is that normal (i.e. should Krita not be using those functions that way),
> or do you suppose this is a QT bug? I'm using QT 4.4.3 (unstable Debs) and
> Krita 2 beta 6 (experimental Debs).
It looks like a Qt problem -- the x and y methods are defined to be in screen
coordinates, not untranslated tablet coordinates. Could you open a bug report
on bugs.kde.org so we can track the issue?
Thanks for investigating!
--
Boudewijn Rempt | http://www.valdyas.org
More information about the kimageshop
mailing list