Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Properly handle taps when touch painting
Carsten Hartenfels219572e192ed
diff --git a/libs/ui/input/kis_input_manager.cpp b/libs/ui/input/kis_input_manager.cppindex 6e1275466b..a3795e9931 100644--- a/libs/ui/input/kis_input_manager.cpp+++ b/libs/ui/input/kis_input_manager.cpp@@ -798,6 +798,14 @@ bool KisInputManager::eventFilterImpl(QEvent * event)retval = d->matcher.buttonReleased(Qt::LeftButton, touchEvent);d->previousPos = {0, 0};d->touchStrokeStarted = false; // stroke ended+ } else if (!KisConfig(true).disableTouchOnCanvas() && !d->touchHasBlockedPressEvents+ && touchEvent->touchPoints().count() == 1) {+ // If no stroke has been started while touch painting is enabled,+ // the user tapped with one finger, but didn't make any motion that+ // caused us to start a stroke. We produce a press and release in+ // response so that the tool responds to their input.+ d->matcher.buttonPressed(Qt::LeftButton, d->originatingTouchBeginEvent.data());+ d->matcher.buttonReleased(Qt::LeftButton, touchEvent);}endTouch();