Bug 440816 - [regression] Scatter strength value is not loaded correctly for paintop presets on start.
Summary: [regression] Scatter strength value is not loaded correctly for paintop prese...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-10 03:31 UTC by Raghavendra kamath
Modified: 2021-08-10 12:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra kamath 2021-08-10 03:31:13 UTC
SUMMARY
In the nightly build [git ee39d38] the scatter strength value of the brush presets is lost and set to 100% a start. The brush preset is immediately marked dirty due to this change. This goes away when you reload the brush preset. 


STEPS TO REPRODUCE
1. Open the nightly build and create a new document and choose a brush preset which has scatter strength assigned of anything other than 100%. A good brush for this test is c) Pencil-2. Choose this brush preset and then restart Krita
2. Open krita again and load a new document. The previous brush preset should be active now
3. Paint with the brush you'll notice that the scatter is wrong. If you check the preset editor you'll see it is set to 100% while for this preset it should be 9%

This can be reproduced with any brush which has scatter strength other than 100%
Comment 1 Dmitry Kazakov 2021-08-10 11:24:30 UTC
Git commit cf4e1e2880edf910f5ff8377b3eb16ccbbb29535 by Dmitry Kazakov.
Committed on 10/08/2021 at 11:24.
Pushed by dkazakov into branch 'master'.

Fix resetting scatter value on loading the last preset

We should avoid cycling GUI updates while loading the brush

M  +14   -9    plugins/paintops/libpaintop/kis_curve_option_widget.cpp

https://invent.kde.org/graphics/krita/commit/cf4e1e2880edf910f5ff8377b3eb16ccbbb29535
Comment 2 Dmitry Kazakov 2021-08-10 12:11:33 UTC
Git commit dc559d37afebc450d4fc2bf73f6b837dd854171b by Dmitry Kazakov.
Committed on 10/08/2021 at 12:11.
Pushed by dkazakov into branch 'master'.

Fix the presets become dirty on Krita start

There are some cycling signal dependencies in the resource view
initialization steps. The trace of the bug was like that:

1) The document adds its own storage
2) The tag model updates all the views with filterChanged signal
3) KisPatternChooser recieves resourceSelected() signal from
   KisResourceItemChooser
4) KisPatternChooser notifies the preset that its pattern has changed

This patch breaks this chain by ensuring that KisResourceItemChooser
does not emit resourceSelected() if the resource hasn't actually changed.
This solution is not ideal. Ideally we should properly do the cold-
initialization on connection of the view to the chooser and make sure
that the signals are emitted only when there is a real change in selection.
Right now this ideal solution doesn't work because there is no
cold-inialization at all, instead initialization relies on the signals.
Therefore, if I add deduplication of signals into
KisResourceItemListView::selectionChanged, the widgets are not initialized
properly.

M  +6    -4    libs/resourcewidgets/KisResourceItemChooser.cpp

https://invent.kde.org/graphics/krita/commit/dc559d37afebc450d4fc2bf73f6b837dd854171b