Bug 395209 - multibrush with distance based brush doesn't use correct starting distance for copied strokes
Summary: multibrush with distance based brush doesn't use correct starting distance fo...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2018-06-10 10:25 UTC by Ben
Modified: 2018-11-20 08:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of wrong distance based brushes (158.63 KB, image/png)
2018-06-10 10:25 UTC, Ben
Details
example brush settings (43.34 KB, image/png)
2018-06-10 10:27 UTC, Ben
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben 2018-06-10 10:25:53 UTC
Created attachment 113191 [details]
Screenshot of wrong distance based brushes

- Select multibrush tool (keep default settings, 4 brushes)
- Create a brush with flow size based on distance (everything else off)
- Draw

The cloned strokes will not start at distance 0, they start thicker/different than the original stroke.

It looks like the cloned strokes use the distance from original stroke start point to cloned stroke start point as starting distance instead 0 for every cloned stroke. 

So the further away from the center the bigger is the starting distance for the cloned brushes.

Tested with nightly build krita-nightly-x64-v4.0.3-87-gace6d8252a-setup.exe and with release 4.0.3. Platform Windows 10, x64.

Not sure if i selected the correct component (Brush engines)
Comment 1 Ben 2018-06-10 10:27:38 UTC
Created attachment 113192 [details]
example brush settings
Comment 2 S-Paliwal 2018-09-15 19:08:06 UTC
The issue is reproducible and the "cloned" brush sizes are not taking the correct distance into account as pointed out by the bug reporter.

The bug was tested on an Arch Linux installation with the following software versions: 
Application Version: 4.2.0 (Pre-alpha; Nightly version #223)
KDE Plasma Version: 5.13.5
KDE Frameworks Version: 5.50.0
Qt Version: 5.11.1
Comment 3 Eoin O'Neill 2018-10-14 09:56:27 UTC
So I've investigated this bug pretty thoroughly now and I think I have a general idea of how/why this happens. Basically, it seems as though all brush instances in multihand mode seem to use the same starting position on canvas. This means that if you start in the dead-center of the mirror planes, for instance, you will get perfectly symmetrical results. However, if you start away from the mirror planes, it will create differ between brush instances and therefore produce different results.
Comment 4 Eoin O'Neill 2018-10-14 14:07:28 UTC
Git commit 393cf3bd7f26a60300f7d9cd1237f42828b98fb5 by Eoin O'Neill.
Committed on 14/10/2018 at 14:04.
Pushed by eoinoneill into branch 'master'.

Fixed brush distance option for multihand tool.

All cloned and transformed brushes were using the same starting
location. I simply had to apply the translation once at brush
stroke info creation so that each brush would have their own
proper starting position.

M  +10   -0    libs/image/kis_distance_information.cpp
M  +3    -0    libs/image/kis_distance_information.h
M  +1    -0    libs/ui/kis_mask_manager.cc
M  +9    -1    libs/ui/tool/kis_tool_multihand_helper.cpp

https://commits.kde.org/krita/393cf3bd7f26a60300f7d9cd1237f42828b98fb5
Comment 5 Halla Rempt 2018-11-20 08:58:35 UTC
Git commit e6d493198dbde5161cd95169b948b51ed8a9e7d1 by Boudewijn Rempt, on behalf of Eoin O'Neill.
Committed on 20/11/2018 at 08:22.
Pushed by rempt into branch 'krita/4.1'.

Fixed brush distance option for multihand tool.

All cloned and transformed brushes were using the same starting
location. I simply had to apply the translation once at brush
stroke info creation so that each brush would have their own
proper starting position.

M  +10   -0    libs/image/kis_distance_information.cpp
M  +3    -0    libs/image/kis_distance_information.h
M  +1    -0    libs/ui/kis_mask_manager.cc
M  +9    -1    libs/ui/tool/kis_tool_multihand_helper.cpp

https://commits.kde.org/krita/e6d493198dbde5161cd95169b948b51ed8a9e7d1