Bug 397831 - Jittery brush rotation with mirror in pixel engine when precision is less than 5
Summary: Jittery brush rotation with mirror in pixel engine when precision is less than 5
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 4.1.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: needs_verification, triaged
Depends on:
Blocks:
 
Reported: 2018-08-24 10:29 UTC by radian
Modified: 2020-05-01 17:19 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
this is how it looks like (136.81 KB, image/jpeg)
2018-08-24 10:29 UTC, radian
Details
example of preset for mirror bug (36.82 KB, image/png)
2018-08-24 10:31 UTC, radian
Details
preset with rotation lock (36.78 KB, image/png)
2018-08-24 10:31 UTC, radian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description radian 2018-08-24 10:29:44 UTC
Created attachment 114576 [details]
this is how it looks like

So, here is two similar bugs related to brush rotation:

1) Rotation with mirror enabled. I guess some of mirrored stamps take rotation info from "original" stroke. Slow strokes works fine while fast strokes looks quite bad. Tested with direction and tilt rotation.
Only happens if Precision is less than 5.

2) Brushes with Rotation > Drawing angle + Lock. Seems like rotation doesn't locks from first stamp, I can even rotate it to 180° before locking.
Also sometimes it lock very different rotation (examples on the right). Weird part: it happens a lot with horizontal strokes from right to left but rarely in other directions. Even weirder part: seems like this "from right to left" direction related to canvas because if I rotate canvas at 90° it will happens from top to bot (or from bot to top).
Comment 1 radian 2018-08-24 10:31:14 UTC
Created attachment 114577 [details]
example of preset for mirror bug
Comment 2 radian 2018-08-24 10:31:56 UTC
Created attachment 114578 [details]
preset with rotation lock
Comment 3 Halla Rempt 2018-09-01 12:03:07 UTC
Could this be the same issue as in https://bugs.kde.org/show_bug.cgi?id=393336 ?
Comment 4 Emmet O'Neill 2018-09-16 05:07:10 UTC
It sounds like the second issue ("Brushes with Rotation > Drawing angle + Lock.") may be a duplicate.

As for the first issue, if I understand correctly they're saying when using symmetry occasionally individual brush dabs are rotated incorrectly. I can't reproduce this as my tablet doesn't have rotation support.
Comment 5 radian 2018-10-04 11:18:45 UTC
Honestly bug 393336 sounds very different from this one.

First issue can be reproduced even with mouse.
1) chose some asymmetrical brush tip 
2) set precision less that 5
3) enable some rotation dynamics (drawing angle\fade\distance\time, pressure too)
4) enable symmetry (both horizontal and vertical have this problem)
5) make a quick stroke
Comment 6 til.schmitter 2019-08-13 18:00:44 UTC
similar to what radian said, i encountered this bug today.

the easiest way to reproduce this is taking a brush from the pixel engine, making it square, lowering the precision and enabling drawing angle->rotation.
when you now paint diagonal strokes with mirroring on, you see jittering.

i quickly tested this with on the color smudge engine, but the problem doesn't seem to happen there
Comment 7 vanyossi 2019-08-13 18:25:16 UTC
This bug is different from bug 393336 as it only happens with precision lower than 5.

Thanks to the simple instructions its very easy to reproduce and test the bug. I might as well fix it once my list gets shorten.
Comment 8 Dmitry Kazakov 2020-03-12 21:08:36 UTC
I have a feeling that I've fixed something like that recently...

It might have the fix like I did for ratio in 56199164d821733b79f81fe978ef5d844178e527
Comment 9 Dmitry Kazakov 2020-05-01 14:47:49 UTC
I can still reproduce the bug in krita/4.3
Comment 10 Dmitry Kazakov 2020-05-01 17:18:29 UTC
Git commit 6b49984f2a04d14a4a04cfae2c61910a1956d1fa by Dmitry Kazakov.
Committed on 01/05/2020 at 17:18.
Pushed by dkazakov into branch 'krita/4.3'.

Fix double-mirrored dabs when painting with precision < 5

Even though KisDabRenderingQueue returns mutable dabs, it doesn't
guarantee that they will be unique in the returned list. We should
be very careful with them and ensure that we don't mirror the same
paint device twice.

M  +2    -2    libs/image/kis_painter.cc
M  +1    -1    libs/image/kis_painter.h
M  +7    -3    libs/image/krita_utils.cpp
M  +1    -1    libs/image/krita_utils.h
M  +14   -2    plugins/paintops/defaultpaintops/brush/kis_brushop.cpp

https://invent.kde.org/kde/krita/commit/6b49984f2a04d14a4a04cfae2c61910a1956d1fa
Comment 11 Dmitry Kazakov 2020-05-01 17:19:02 UTC
Git commit ae915410fea8ce5a6024689dd19df763b08386d4 by Dmitry Kazakov.
Committed on 01/05/2020 at 17:18.
Pushed by dkazakov into branch 'master'.

Fix double-mirrored dabs when painting with precision < 5

Even though KisDabRenderingQueue returns mutable dabs, it doesn't
guarantee that they will be unique in the returned list. We should
be very careful with them and ensure that we don't mirror the same
paint device twice.

M  +2    -2    libs/image/kis_painter.cc
M  +1    -1    libs/image/kis_painter.h
M  +7    -3    libs/image/krita_utils.cpp
M  +1    -1    libs/image/krita_utils.h
M  +14   -2    plugins/paintops/defaultpaintops/brush/kis_brushop.cpp

https://invent.kde.org/kde/krita/commit/ae915410fea8ce5a6024689dd19df763b08386d4