Bug 425830

Summary: Colorize Masks always set to visible when opening a file
Product: [Applications] krita Reporter: Tiar <tamtamy.tymona>
Component: File formatsAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73
Priority: NOR    
Version: 4.3.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: File with invisible Colorize Mask

Description Tiar 2020-08-26 12:19:20 UTC
Created attachment 131197 [details]
File with invisible Colorize Mask

SUMMARY
After saving and reopening a file with Colorize Mask, it will be always set to visible even if it was saved invisible.


STEPS TO REPRODUCE
1. Create or open a file with Colorize Mask.
2. Set the mask invisible.
3. Save. (remember to Save As or make sure the file is modified so the changes are actually saved).
4. Open the file in Krita.

OBSERVED RESULT
Colorize Mask is visible now.

EXPECTED RESULT
Colorize Mask should be set to the state that was saved in the file.

ADDITIONAL INFORMATION
This is a regression that happened between 4.1.7 and 4.2.0. (4.2.0 already has this issue).
The file is saved correctly, maindoc.xml says 'visible="0"', files created in 4.2.0 and later can be opened fine in 4.1.7 with the mask invisible as it should be.

SOFTWARE/OS VERSIONS
Krita

 Version: 4.3.0
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8
Comment 1 Dmitry Kazakov 2020-08-27 21:17:47 UTC
Git commit e19f0b97c05a264b72f018ed527cd7999757568e by Dmitry Kazakov.
Committed on 27/08/2020 at 21:17.
Pushed by dkazakov into branch 'krita/4.3'.

Fix loading visibility of colorize masks

We shouldn't use KisLayerPropertiesIcons::setNodePropertyAutoUndo()
unless we are ready the action to happen asynchronously in a stroke.

In the loading code we should just assign the properties directly,
without doing any updates or undo actions.

M  +1    -1    libs/image/commands/kis_node_property_list_command.cpp
M  +1    -1    libs/image/commands/kis_node_property_list_command.h
M  +2    -2    libs/image/kis_layer_properties_icons.cpp
M  +1    -2    libs/image/kis_layer_properties_icons.h
M  +1    -1    libs/ui/kis_node_manager.cpp
M  +4    -2    plugins/impex/libkra/kis_kra_loader.cpp
M  +3    -2    plugins/impex/libkra/tests/kis_kra_saver_test.cpp
M  +17   -17   plugins/tools/tool_lazybrush/kis_tool_lazy_brush.cpp
M  +3    -3    plugins/tools/tool_lazybrush/kis_tool_lazy_brush_options_widget.cpp

https://invent.kde.org/graphics/krita/commit/e19f0b97c05a264b72f018ed527cd7999757568e
Comment 2 Dmitry Kazakov 2020-08-27 21:17:59 UTC
Git commit b1ff4c756694add2aa4bf3815ac82621973bb105 by Dmitry Kazakov.
Committed on 27/08/2020 at 21:17.
Pushed by dkazakov into branch 'master'.

Fix loading visibility of colorize masks

We shouldn't use KisLayerPropertiesIcons::setNodePropertyAutoUndo()
unless we are ready the action to happen asynchronously in a stroke.

In the loading code we should just assign the properties directly,
without doing any updates or undo actions.

M  +1    -1    libs/image/commands/kis_node_property_list_command.cpp
M  +1    -1    libs/image/commands/kis_node_property_list_command.h
M  +2    -2    libs/image/kis_layer_properties_icons.cpp
M  +1    -2    libs/image/kis_layer_properties_icons.h
M  +1    -1    libs/ui/kis_node_manager.cpp
M  +4    -2    plugins/impex/libkra/kis_kra_loader.cpp
M  +3    -2    plugins/impex/libkra/tests/kis_kra_saver_test.cpp
M  +17   -17   plugins/tools/tool_lazybrush/kis_tool_lazy_brush.cpp
M  +3    -3    plugins/tools/tool_lazybrush/kis_tool_lazy_brush_options_widget.cpp

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