Fix bad rendering of text shapes
Before this commit, white text over white canvas would be visible because of artifacts. This commit fixes it and now white text over white canvas is invisible in case there is no additional "stroke".
WARNING: it changes the rendering of old files! (however one could argue that the previous rendering was wrong)
https://bugs.kde.org/show_bug.cgi?id=418141
Test Plan
Main test:
-
Open the test file in the version before my changes: font_rendering_bug_report__418141__001.kra
Result: there are artifacts from white text over white canvas
-
Open the test file with changes from this MR.
Result: white text over white canvas is invisible
Other tests to see what the wrong behaviour is about:
- Open the test file in the version before the changes.
- Click on the ugly text, go to Tool Options (make sure you're still in the Select Shapes Tool), go to "Stroke", select "None" (even though it looks like it's already selected). The text should look ok now.
- Double-click on the nice text, go to SVG editor. See that it has
stroke-opacity="0"
andstroke=#000000
options. Switch to Rich Text editor, switch to SVG again. The SVG text changed (*which is another bug I will be fixing; no need to convert between them all the time when there were no changes made by the user), and now the text looks ugly.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Agata Cacko