I had a look at the Krita sources, as pointed out by Jussi, and the problem does not come from the kis_canvas_controller code, but seems to come from kis_canvas_widget_base.cpp.
My debugging shows that the problem is in the Qt hiResGlobalPos method from QTabletEvent.
event->pos() seems to give correct results for the QTabletEvent, but
event->hiResGlobalPos() sometimes gives strange results that cause the random lines.
For exemple, I have the following values from hiResGlobalPos (the x coordinate):
So my guess is that Qt has problem getting the correct values for this hiResGlobalPos, if anybody with a better inside knowledge of Qt can have a look...
I had a look at the Krita sources, as pointed out by Jussi, and the problem does not come from the kis_canvas_ controller code, but seems to come from kis_canvas_ widget_ base.cpp.
There, we have the following code:
void KisCanvasWidget Base::processTa bletEvent( QTabletEvent *e) )->setFocus( Qt::OtherFocusR eason); >blockMouseEven t.start( 100);
{
widget(
m_d-
const QPointF pos = e->hiResGlobalPos() - widget( )->mapToGlobal( QPoint( 0, 0)); >toolProxy- >tabletEvent( e, m_d->coordinate sConverter- >widgetToDocume nt(pos) );
m_d-
// HACK >ignorenextMous eEventExceptRig htMiddleClick = true;
e->ignore();
m_d-
// HACK
}
My debugging shows that the problem is in the Qt hiResGlobalPos method from QTabletEvent.
event->pos() seems to give correct results for the QTabletEvent, but hiResGlobalPos( ) sometimes gives strange results that cause the random lines.
event->
For exemple, I have the following values from hiResGlobalPos (the x coordinate):
(...)
453.731
453.682
453.779
12.4536 <--- weird value
453.633
453.487
(...)
So my guess is that Qt has problem getting the correct values for this hiResGlobalPos, if anybody with a better inside knowledge of Qt can have a look...