Bug 447464

Summary: Gradient stops in vector tool don't work
Product: [Applications] krita Reporter: M <getting>
Component: Tools/VectorAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: chris.k.d.wade, keyth2363214, williamrmaher
Priority: NOR    
Version: 5.0.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: video of the bug

Description M 2021-12-24 13:59:46 UTC
Created attachment 144828 [details]
video of the bug

SUMMARY
Gradient stops in vector tool don't work correctly: 
- the toggling of the stops don't work correctly with the < and > buttons (first 7 seconds in the video in the attachment)
- when editing the second, third, fourth etc. stop, allways the first stop is edited (see last part of the video)

STEPS TO REPRODUCE
1. Vector tool -> make polygon
2. set gradient as fill
3. Select stop with arrow ( "<" ">") buttons
4. Edit color of the stop

OBSERVED RESULT


EXPECTED RESULT


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

ADDITIONAL INFORMATION
Comment 1 keyth_qcfx2 2021-12-27 08:19:30 UTC
situations verified:
-selects far away stops
-creates and pulls and then swaps between them super fast.
-not being able to select at all
-while selecting colors it can changes stops.
Comment 2 Tiar 2022-01-08 12:56:26 UTC
*** Bug 448103 has been marked as a duplicate of this bug. ***
Comment 3 wolthera 2022-01-11 12:31:34 UTC
*** Bug 448228 has been marked as a duplicate of this bug. ***
Comment 4 Bug Janitor Service 2022-06-27 11:29:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1491
Comment 5 amyspark 2022-06-28 19:50:53 UTC
Git commit fc362afcb2954d10f8391f803b44a4c2ac88de39 by L. E. Segovia, on behalf of Sharaf Zaman.
Committed on 28/06/2022 at 19:49.
Pushed by lsegovia into branch 'master'.

Bugfix: Gradient fill stops can't be changed for vector objects

What resulted in the bug is firing of selectionContentChanged() signal
after the setNewGradientBackgroundToShape() routine had returned --
because the blocker for d->shapeChangedAcyclicConnector had already been
destroyed. And when the shapeChanged method was called, it sent down the
call assuming gradient was changed (which would reset value of
m_selectedStop) when it wasn't.

Now, we remove signal connections for selectionChanged() and
selectionContentChanged(), because they're delivered asynchronously and
without proper guards (the signal blocker work only in some cases, e.g
on windows they always fire once the guard lifetime has ended).

Removing these signals is safe because we now use resourceManager
signals to update the UI once the underlying resource has changed.
Related: bug 455794, bug 449606, bug 453331

M  +2    -20   libs/ui/widgets/KoFillConfigWidget.cpp

https://invent.kde.org/graphics/krita/commit/fc362afcb2954d10f8391f803b44a4c2ac88de39
Comment 6 amyspark 2022-06-28 19:52:20 UTC
Git commit de938cfc89875c360a0e161b5de723739eedf2cc by L. E. Segovia, on behalf of Sharaf Zaman.
Committed on 28/06/2022 at 19:52.
Pushed by lsegovia into branch 'krita/5.1'.

Bugfix: Gradient fill stops can't be changed for vector objects

What resulted in the bug is firing of selectionContentChanged() signal
after the setNewGradientBackgroundToShape() routine had returned --
because the blocker for d->shapeChangedAcyclicConnector had already been
destroyed. And when the shapeChanged method was called, it sent down the
call assuming gradient was changed (which would reset value of
m_selectedStop) when it wasn't.

Now, we remove signal connections for selectionChanged() and
selectionContentChanged(), because they're delivered asynchronously and
without proper guards (the signal blocker work only in some cases, e.g
on windows they always fire once the guard lifetime has ended).

Removing these signals is safe because we now use resourceManager
signals to update the UI once the underlying resource has changed.
Related: bug 455794, bug 449606, bug 453331
(cherry picked from commit fc362afcb2954d10f8391f803b44a4c2ac88de39)

M  +2    -20   libs/ui/widgets/KoFillConfigWidget.cpp

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