Bug 466130 - Strange behavior of the text-decoration after new text changes
Summary: Strange behavior of the text-decoration after new text changes
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: wolthera
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-20 10:27 UTC by Deif Lou
Modified: 2023-08-02 15:52 UTC (History)
1 user (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 Deif Lou 2023-02-20 10:27:00 UTC
SUMMARY
It seems to be a bug on the rendering of the "text-decoration" property. I think there are two issues involved:
* First, if the property is set to any value, the line is rendered as it is specified, even the wavy and dashed ones, but it seems too thin, like 1px thick. I would expect it to have a thickness proportional to the font size. The thickness property seems to not work, so I don't know if any of that is expected.
* Second, if I then remove the property, instead of the line disappearing, a new, thicker line appears. It is not like a rectangular glitch. If the style is "wavy", for example, the line has that shape with bigger waves (actually closer to what I would expect the thickness to be when the property is activated). Also, if I then change the font size to a smaller size, the line seems to remain unchanged and extend outside the bounding box. Again, all of this happens when the property is deleted. If the property is set, then the line seems to update right. When this line extends outside the bounding box, some traces of that outside portion ar left on the canvas if I move the box.

STEPS TO REPRODUCE
1. Create a text box and open the edit dialog.
2. In the svg tab add, the "text-decoration: underline" (or a valid value other than underline) to the "style" attribute.
3. Delete the property.
4. (For the outside of bounding box unwanted traces) Set the font size to a smaller size and move the box.

OBSERVED RESULT
The line decoration does not disappear when the "text-decoration" property is removed.
There are some traces if the line extends outside the bounding box of the text.
Sample video of the issue: https://www.youtube.com/watch?v=B_6jWV6rimY

EXPECTED RESULT
The line decoration disappears when the "text-decoration" property is removed, and because of that there are no possible unwanted traces outside the bounding box.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
System Qt Version: 5.15.8
Krita: Version: 5.2.0-prealpha (git 522c48f)
Krita Qt:  Version (compiled): 5.15.7,  Version (loaded): 5.15.7
Comment 1 wolthera 2023-02-20 11:59:04 UTC
Caching problem, likely...
Comment 2 wolthera 2023-08-02 11:42:20 UTC
Git commit 1f28bf0bfb952dfb6996e6708e847925bb163eff by Wolthera van Hövell tot Westerflier.
Committed on 02/08/2023 at 13:41.
Pushed by woltherav into branch 'master'.

Fix text-decoration not getting cleared when set as 'none'.

Turns out the clearing of the decoration was never called.

M  +1    -2    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/graphics/krita/-/commit/1f28bf0bfb952dfb6996e6708e847925bb163eff
Comment 3 wolthera 2023-08-02 15:52:57 UTC
Git commit 87534d44495479160c65213b2f463d8df1374be5 by Wolthera van Hövell, on behalf of Wolthera van Hövell tot Westerflier.
Committed on 02/08/2023 at 17:52.
Pushed by woltherav into branch 'krita/5.2'.

Fix text-decoration not getting cleared when set as 'none'.

Turns out the clearing of the decoration was never called.


(cherry picked from commit 1f28bf0bfb952dfb6996e6708e847925bb163eff)

M  +1    -2    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/graphics/krita/-/commit/87534d44495479160c65213b2f463d8df1374be5