OK, good news I guess, this turned out to be really straightforward to implement. Heh, working on Krita is so unpredictable
Sometimes I want to fix “a simple” thing and I get stuck for days, or another time it looks like a lot of work at first, but then I breeze through it. Anyway, I digress ![]()
I created a tester brush. At 0 degrees brush tip rotation it points to the right:
Adding the tip rotation of 45 degrees rotates it counter-clockwise:
When you turn on Rotation > Tilt direction, at 0% it adds a -180 degrees offset, which will flip the arrow like this. I double checked that this is consistent with the existing behavior.
You might have noticed the new offset field that has appeared. It is currently not effective, because I’m using a mouse and the value is 0 anyway:
If this stays at 0 and I now pick up my pen, the arrow would get rotated. If I try to hold the pen at a reasonably natural, right-hand person angle, the arrow becomes horizontal:
(Forum rules: I took this photo myself with my left hand)
Adding the compensation angle of 135 degrees “fixes it” (45 - 180 = -135):
Now, the only caveat is that I used the aforementioned (xTilt != 0) || (yTilt != 0) heuristic to detect if the device is supporting tilt or not, which isn’t perfect. If you hold the stylus perfectly vertically, it will “think” it’s a no-tilt device and don’t apply the offset, meaning the cursor will thrash between two rotations. However, given how unnatural that position is, I think this is good enough. Hopefully.
Moreover, as far as I can tell, X/Y tilt are Qt tablet events and they are integers in Qt5, but become floats (decimals) in Qt6. So it’s possible this issue will go away once we upgrade Krita, because there’s no way you can hold a pen freehand and get 0.000 tilt ![]()
OK, that’s pretty much it. I will do a bit more testing and look at @wojtryb’s request next and then decide whether to post it in a single MR or not. For now I only pushed the source to my branch. ![]()






