Bug 496519 - Editing handles of mesh gradient raises safe assert
Summary: Editing handles of mesh gradient raises safe assert
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Vector (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-20 22:56 UTC by Vitamorus
Modified: 2024-12-12 15:04 UTC (History)
0 users

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


Attachments
Rendering errors in the "frame" (29.94 KB, image/png)
2024-11-20 22:56 UTC, Vitamorus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitamorus 2024-11-20 22:56:52 UTC
Created attachment 175992 [details]
Rendering errors in the "frame"

A safe assert is raised when editing the handles of a mesh gradient. I am unable to reproduce it in 5.2.6, meaning it's new for 5.3. Probably related is some rendering errors of the "frame" around the vector shape in question.

Steps to reproduce:

1. Create a new document
2. Add a vector layer and draw a shape (like a rectangle)
3. Set the fill to Mesh Gradient and try moving some of the handles around.
4. A warning dialog will appear:
 
Krita has encountered an internal error:
SAFE ASSERT (krita): "!m_sanityIsStarting" in file /builds/graphics/krita/libs/global/kis_signal_compressor.cpp, line 210

5. Clicking "Ignore" results in a second dialog with:
SAFE ASSERT (krita): "m_timer->isActive()" in file /builds/graphics/krita/libs/global/kis_signal_compressor.cpp, line 148
Comment 1 Vitamorus 2024-11-21 14:59:29 UTC
Double checking, the rendering error show up in 5.2.6 but not the safe asserts.
Comment 2 Vitamorus 2024-11-21 16:32:39 UTC
Had a friend test this on 5.2.8 (Android only) and couldn't reproduce the safe assert. It does happen in Krita Plus 5.2.9 pre-alpha.
Comment 3 Dmitry Kazakov 2024-12-12 14:49:57 UTC
Git commit 0842ec2b208f4dfa9411062c7e1fdde600d8fab0 by Dmitry Kazakov.
Committed on 12/12/2024 at 14:49.
Pushed by dkazakov into branch 'master'.

Fix an assert when modifying Mesh Gradient on a shape

We shouldn't add any commands to the global undo stack in the mouse
move event handler. Instead, we should accumulate the command and add
it to the stack in teh very end of the operation in createCommand()
method.

The patch also fixes a memory leak, which caused the temporary command
to leak in case when the merge-branch was taken.

M  +13   -0    libs/command/kis_command_utils.cpp
M  +9    -0    libs/command/kis_command_utils.h
M  +3    -8    libs/flake/tools/KoPathControlPointMoveStrategy.cpp
M  +3    -7    libs/flake/tools/KoPathPointMoveStrategy.cpp
M  +8    -10   plugins/tools/defaulttool/defaulttool/ShapeGradientEditStrategy.cpp
M  +11   -2    plugins/tools/defaulttool/defaulttool/ShapeMeshGradientEditStrategy.cpp

https://invent.kde.org/graphics/krita/-/commit/0842ec2b208f4dfa9411062c7e1fdde600d8fab0
Comment 4 Dmitry Kazakov 2024-12-12 15:04:28 UTC
Git commit c924b0e4f48ae97f24a24421dbeae72de5505ba6 by Dmitry Kazakov.
Committed on 12/12/2024 at 15:03.
Pushed by dkazakov into branch 'krita/5.2'.

Fix an assert when modifying Mesh Gradient on a shape

We shouldn't add any commands to the global undo stack in the mouse
move event handler. Instead, we should accumulate the command and add
it to the stack in teh very end of the operation in createCommand()
method.

The patch also fixes a memory leak, which caused the temporary command
to leak in case when the merge-branch was taken.

M  +13   -0    libs/command/kis_command_utils.cpp
M  +9    -0    libs/command/kis_command_utils.h
M  +3    -8    libs/flake/tools/KoPathControlPointMoveStrategy.cpp
M  +3    -7    libs/flake/tools/KoPathPointMoveStrategy.cpp
M  +8    -10   plugins/tools/defaulttool/defaulttool/ShapeGradientEditStrategy.cpp
M  +11   -2    plugins/tools/defaulttool/defaulttool/ShapeMeshGradientEditStrategy.cpp

https://invent.kde.org/graphics/krita/-/commit/c924b0e4f48ae97f24a24421dbeae72de5505ba6