Review Request 119224: Fix Krita speed sensor

Boudewijn Rempt boud at valdyas.org
Wed Oct 15 17:54:27 BST 2014



> On July 11, 2014, 12:58 p.m., Dmitry Kazakov wrote:
> > Hi, Sven!
> > 
> > This patch is effectively an equivalent of the following patch:
> > http://paste.kde.org/poktyzric
> > 
> > Of course, except that the variable should not be static, but put into d->currentDistanceInfo. Your patch just creates one more timer, which is excessive, since we already have a timer in KisFreehandToolHelper and which is already used for all speed calculations.
> > 
> > The patch doesn't solve the real cause of the speed sensor being broken. The speed doesn't work because we should fetch the time data from the XInput/Wintab event directly, instead of running a timer in parallel. The trick is that on both windows and linux the packets are coming in chunks and Qt's event loop processes the whole chunk of packets in one go. So measuring time with a timer gives the same time for the whole chunk, which is not what we need.
> > 
> > I'm ok with introducing a limitation you proposed (timeDiff > 5 msec), but the second timer is not needed. Everything can be implemented inside KisPaintInformation.

So, what's the status now? Should we discard this patch and do a new one?


- Boudewijn


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119224/#review62133
-----------------------------------------------------------


On July 11, 2014, 3:30 a.m., Sven Langkamp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119224/
> -----------------------------------------------------------
> 
> (Updated July 11, 2014, 3:30 a.m.)
> 
> 
> Review request for Calligra, Dmitry Kazakov and Boudewijn Rempt.
> 
> 
> Bugs: 325423
>     http://bugs.kde.org/show_bug.cgi?id=325423
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> The speed sensor is currently broken. The problem is that the speed is calculated with the distance and time difference each dab and the previous one. When the space between the dabs becomes to small the calculation breakes and falls back to a constant value.
> 
> The patch fixes the problem by calculating the speed of every event and then interpolating the speed between them. It also makes sure that there a minimum time difference between the measurements.
> 
> 
> Diffs
> -----
> 
>   krita/image/brushengine/kis_paint_information.h 9b3be8f 
>   krita/image/brushengine/kis_paint_information.cc 952f51f 
>   krita/ui/tool/kis_painting_information_builder.h 993c25b 
>   krita/ui/tool/kis_painting_information_builder.cpp 6e3d19a 
> 
> Diff: https://git.reviewboard.kde.org/r/119224/diff/
> 
> 
> Testing
> -------
> 
> Tested by painting in Krita and appears to work. Needs further testing to see if it gives the expected results.
> 
> 
> Thanks,
> 
> Sven Langkamp
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20141015/ee64c805/attachment.htm>


More information about the calligra-devel mailing list