Bug 431611

Summary: Transform tool sticks to stylus when attempting to resize
Product: [Applications] krita Reporter: Dorian Zambo <nariod14>
Component: Tools/TransformAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: anna.medonosova, halla, shzam
Priority: NOR Keywords: triaged
Version: 4.4.2-beta2   
Target Milestone: ---   
Platform: Android   
OS: Android 10.x   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dorian Zambo 2021-01-14 21:09:07 UTC
SUMMARY
When using the transform tool on android, after trying to resize using one of the corners on a selection, lifting the pen and pressing it down again will teleport that corner to the new location of the pen, and it remains sticky as such. I'm unsure of what makes it stop, but I've managed to get it to unstick accidentally when i was trying to move the middle anchor, but after that the anchor sticks as well and I can't rotate or resize, any pen presses just teleport move the anchor.

I am on a Samsung Galaxy Tab S6 lite running Android 10 on version 4.2.2 beta2. This issue is also present on the version available on the Play Store.

STEPS TO REPRODUCE
1. Draw anything on the canvas
2. Make a selection
3. Switch to the transform tool
4.Try resizing using the corners

OBSERVED RESULT

The selection will teleport to wherever you place the S-pen stylus after letting go, preventing you from panning or rotating the image and instead resizing the image in an unwanted manner.

EXPECTED RESULT

After resizing using the corner the transform tool should reset and allow further actions to resize, pan or rotate the selection.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

I'm using the version downloaded off here: https://krita.org/en/item/second-beta-for-krita-4-4-2/ the ARM 64 bit version. I'm hoping all the above info is provided henceforth.

ADDITIONAL INFORMATION

None.
Comment 1 Anna Medonosova 2021-01-18 10:20:11 UTC
I can confirm this behavior on my Galaxy Tab S6. It might be related, that when dragging either the handles or a point outside/inside the transformed area, the action (move, scale, shear, ...) Krita performs is not always what I would expect, based on experience from the desktop version (e.g. it shears instead of scaling when dragging the handle). Also, the cursor does not change to reflect the current action.
Comment 2 Dorian Zambo 2021-01-18 12:57:24 UTC
(In reply to Anna Medonosova from comment #1)
> I can confirm this behavior on my Galaxy Tab S6. It might be related, that
> when dragging either the handles or a point outside/inside the transformed
> area, the action (move, scale, shear, ...) Krita performs is not always what
> I would expect, based on experience from the desktop version (e.g. it shears
> instead of scaling when dragging the handle). Also, the cursor does not
> change to reflect the current action.

I found that a temporary fix is that once you're done transforming tap a random area and undo, and the tool seems to reset and allow you to rotate and scale and all that again. It's rather annoying to do but it works for now at least.
Comment 3 sh_zam 2021-01-18 20:25:24 UTC
Hello!

I have pushed the fix:
https://invent.kde.org/szaman/krita/-/commit/21f70cc18a38e94fce2170b9e10375296b8824d0
I will test this properly with different devices and get it in nightly ASAP :)
Comment 4 Dorian Zambo 2021-01-19 00:26:11 UTC
(In reply to Sharaf from comment #3)
> Hello!
> 
> I have pushed the fix:
> https://invent.kde.org/szaman/krita/-/commit/
> 21f70cc18a38e94fce2170b9e10375296b8824d0
> I will test this properly with different devices and get it in nightly ASAP
> :)

Awesome! I had a look and it seems the nightly versions are only available for windows and Linux despite having fixes in there that also pertain to the android version. Is there any possibility that nightly versions could also be released on android, like in the future that is. I've been a fan of testing out experimental and in development builds since homebrewing on the PSP and 3DS and I'd love to help any way i can!
Comment 5 Bug Janitor Service 2021-01-19 07:38:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/655
Comment 6 Halla Rempt 2021-01-19 09:54:48 UTC
Git commit 6fe29b52ff896a2766d42964aea217966af61173 by Halla Rempt, on behalf of Sharaf Zaman.
Committed on 19/01/2021 at 09:53.
Pushed by rempt into branch 'master'.

Android: Properly handle tablet events

Qt didn't properly pass down tablet events which caused problems with
hovering, TabletPress/Release.
Related: bug 423299, bug 429940

D  +0    -76   3rdparty/ext_qt/0098-Handle-Primary-and-Secondary-stylus-buttons-on-Andro.patch
A  +107  -0    3rdparty/ext_qt/0102-Android-Properly-handle-Tablet-events.patch
M  +1    -1    3rdparty/ext_qt/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/6fe29b52ff896a2766d42964aea217966af61173
Comment 7 Dorian Zambo 2021-01-22 00:04:08 UTC
Apologies if its not within my powers to re-open this but I thought it might be better than making another report on a known bug.

The bug has been reduced, the effects of the teleporting seem to reset a bit more often without the need to undo after the 4.4.2 update but it definitely still happens quite a bit. When the teleporting or "sticking" happens, the undo fix still seems to work and "reset" the transform box, but the sticking still happens.

I've done a bit more testing and it seems to also occur with the other types of transform too. Warp transform and perspective transform seem to have the same issue as well.

It's definitely a manageable bug with the undo fix bit it would be great if it was fixed too!
Comment 8 sh_zam 2021-01-22 19:40:13 UTC
:)

This bug has been fixed, however sadly it didn't make it to our 4.4.2 release, perhaps I was too slow. Though, I could share an APK if you'd like to test it.
Comment 9 Dorian Zambo 2021-01-22 21:44:11 UTC
(In reply to Sharaf from comment #8)
> :)
> 
> This bug has been fixed, however sadly it didn't make it to our 4.4.2
> release, perhaps I was too slow. Though, I could share an APK if you'd like
> to test it.

OH I thought the fix made it in due to one of the bug fixes under Android being:

*Handle mouse buttons state and touch events properly

That seemed very similar to the merge requests on this bug reports' comment section, apologies for my misunderstanding.

But yes I would love to test out the apk if it doesn't bother you. Once again sorry if the reopenong caused any further issues!
Comment 10 sh_zam 2021-01-23 13:02:16 UTC
Here's an APK signed and built by me, since our binary factory doesn't yet build this patch. :)

https://drive.google.com/file/d/1mrig0vhn2Dn1JTLGiqRgnMhvR23qHr4x/view?usp=sharing
Comment 11 Dorian Zambo 2021-01-23 22:00:46 UTC
Hi again,

I can confirm the apk you sent does have the bug fixed! After what must be cumulative hours of messing around with the buggy transform tool having work so perfectly smoothly is quite surreal. Many thanks for the signed apk, and I'll be using this version for my arting needs for now. I look forward to the next official release!