Bug 408693 - Text goes underneath already placed shape/symbol
Summary: Text goes underneath already placed shape/symbol
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (show other bugs)
Version: 4.2.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-14 14:54 UTC by kaisaki1342
Modified: 2019-06-20 10:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kaisaki1342 2019-06-14 14:54:35 UTC
SUMMARY
When there is already vector shape in place and you added the text/ when you edit it or change the text it goes underneath the already place symbol/shape. 

STEPS TO REPRODUCE
1. Add a vector shape
2. add a text - edit the text
3. As soon as text is change text goes underneath. 
Video
https://youtu.be/KNkP_wNRFWQ

OBSERVED RESULT
when text is added/editted it goes underneath previously added shape. Instead of staying / being on top of it.

EXPECTED RESULT
It should stay on top of the previously added object. 


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

ADDITIONAL INFORMATION
Comment 1 Ahab Greybeard 2019-06-15 13:47:35 UTC
I can confirm this and the situation is a bit complicated.
Testing with Linux appimages:

It doesn't happen in 4.1.7.

It happens in 4.2.1 and a new text box is created and placed below all non-text objects in the layer. That text object can then be raised. Further editing of the text object will place it below all non-text objects in the layer.

In the latest krita-4.3.0-prealpha-2bd45ac-x86_64.appimage the behaviour is different.
When a new text box is created, it is placed above the lowest non-text object in the layer. It can be raised (or lowered). If it is then edited, it will be placed above the lowest non-text object in the layer.
The text boxes themselves seem to have their own stack order with respect to each other so that if two text boxes are edited so as to send them to be above the lowest non-text object, the second one edited may then be above or below the first edited text box depending on what was their relative order before they were edited.

I'll try to check this again with the next nightly build which is due to have a vector layer related commit incorporated into it.
Comment 2 Ahab Greybeard 2019-06-15 17:33:41 UTC
I've just tested the 15th June 	krita-4.3.0-prealpha-bebb0d6-x86_64.appimage and it is now different.

Creating and editing a text object makes it go one level lower than the highest non-text object on the layer. Further to that, it then goes one layer lower than the highest of any other text boxes that are also immediately under that highest level non-text object. Text boxes seem to have their own stacking order separate from non-text objects but subsidiary to non-text objects.
Comment 3 Halla Rempt 2019-06-17 08:38:10 UTC
Dmitry will have to look into this, he might remember where to begin searching for the z-order handling in flake...
Comment 4 Dmitry Kazakov 2019-06-19 10:24:00 UTC
Git commit 23842d24790b826d4621787a95705ee74d2d9dc0 by Dmitry Kazakov.
Committed on 19/06/2019 at 10:23.
Pushed by dkazakov into branch 'master'.

Fix resetting zIndex of text shapes on editing

We shouldn't reset zIndex of the shape when we only update it

M  +4    -1    libs/flake/svg/SvgParser.cpp

https://invent.kde.org/kde/krita/commit/23842d24790b826d4621787a95705ee74d2d9dc0
Comment 5 Halla Rempt 2019-06-20 10:49:28 UTC
Git commit 6785acfb535d8809b663516e8ebdc0fe2cad92e3 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 20/06/2019 at 10:33.
Pushed by rempt into branch 'krita/4.2'.

Fix resetting zIndex of text shapes on editing

We shouldn't reset zIndex of the shape when we only update it

M  +4    -1    libs/flake/svg/SvgParser.cpp

https://invent.kde.org/kde/krita/commit/6785acfb535d8809b663516e8ebdc0fe2cad92e3