Bug fix: Ctrl-activated color picker no longer glitches out when double clicking with a mouse.
ClosedPublic

Authored by emmetoneill on May 18 2018, 6:18 AM.

Details

Summary

Currently a glitch exists where double clicking with a mouse while using the ctrl key-activated color picker causes the KisAbstractInputAction::eventPos and `KisAbstractInputAction::eventPosF functions to return an incorrect value, which then causes the ctrl-picker to return an undefined and unwanted color (usually black or white).

This patch fixes this bug by simply adding the QEvent::MouseButtonDblClick case to both switch statements, returning the correct position info for the abstract input events.

I believe this should close https://bugs.kde.org/show_bug.cgi?id=394396 . Although the user reported a crash associated with this bug, I was unable to reproduce any.

I also threw in some tiny formatting/style changes while I was in those files.

Test Plan

Using a mouse, select the Brush Tool, hold the Ctrl Key to pop up a color picker, and double click.

Without this patch applied the picked color will often incorrectly be pure black or pure white, which seems to change depending on the zoom level.

After this patch, double clicking should not create any unwanted or unpredictable behavior from the ctrl-picker.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
emmetoneill requested review of this revision.May 18 2018, 6:18 AM
emmetoneill created this revision.
emmetoneill added reviewers: Krita, rempt, dkazakov.
dkazakov accepted this revision.May 18 2018, 7:23 PM

Hi, @emmetoneill!

Thanks you very much for the patch! It looks good! I'll push it now :)

This revision is now accepted and ready to land.May 18 2018, 7:23 PM
This revision was automatically updated to reflect the committed changes.