Bug 515967 - Text Tool runs into rendering issues while undoing/redoing
Summary: Text Tool runs into rendering issues while undoing/redoing
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (other bugs)
Version First Reported In: 6.0.0-beta1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-13 23:32 UTC by Vitamorus
Modified: 2026-03-10 17:45 UTC (History)
2 users (show)

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


Attachments
Text clipping on Undo (538.67 KB, video/mp4)
2026-02-13 23:32 UTC, Vitamorus
Details
Inconsitent rendering on redo/undo actions (1.43 MB, video/mp4)
2026-02-13 23:33 UTC, Vitamorus
Details
system info (16.63 KB, text/plain)
2026-02-13 23:34 UTC, Vitamorus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitamorus 2026-02-13 23:32:44 UTC
Created attachment 189547 [details]
Text clipping on Undo

SUMMARY
Krita will occasionally run into some clipping/rendering issues when editing text and trying to undo/redo the editing. It's a bit random but I think I found one way to reproduce it consistently.

STEPS TO REPRODUCE
1. Create new document
2. Add a text object with 'Placeholder Text'
3. Click on the space between the 'd' and the 'e' twice; once to enable editing and a second time to remove the highlight and place the caret.
4. Press Enter to add a new line and then Ctrl+Z to undo.
5. Part of the text doesn't render

There's another variation of it as well if you create a couple of text objects, select all the text in one of them and delete it without confirming, and then try to undo the delete 

This was tested with Qt Platform Name:  "wayland". 
Attached is a couple of video recordings of the bug, along with additional system info.
Comment 1 Vitamorus 2026-02-13 23:33:55 UTC
Created attachment 189548 [details]
Inconsitent rendering on redo/undo actions
Comment 2 Vitamorus 2026-02-13 23:34:13 UTC
Created attachment 189549 [details]
system info
Comment 3 Halla Rempt 2026-02-23 13:16:58 UTC
I can reproduce this consistently.
Comment 4 wolthera 2026-03-10 16:36:49 UTC
Git commit 0c53e851024907560d712c6b0d357a5554359682 by Wolthera van Hövell tot Westerflier.
Committed on 10/03/2026 at 16:36.
Pushed by woltherav into branch 'master'.

Make text bulkactions also take into account undo-mementos.

Without this, the text shape thinks it doesn't need to provide
an update rect, leading to rendering errors.

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

https://invent.kde.org/graphics/krita/-/commit/0c53e851024907560d712c6b0d357a5554359682
Comment 5 wolthera 2026-03-10 16:40:49 UTC
Ok, so I thought I had fixed this, but instead I figured out the problem is deeper:

Basically, if a memento (undo info) is used to set the layout, only the rect underneath 1024x1024 pixels will be updated... I am going to experiment further.
Comment 6 wolthera 2026-03-10 17:44:05 UTC
Git commit 9e5359d55fc0874f61dcbc4d776ad843689da4c2 by Wolthera van Hövell tot Westerflier.
Committed on 10/03/2026 at 17:02.
Pushed by woltherav into branch 'master'.

Fix updating text from undo info.

KoShapes need both be updated with updateAbsolute as well as
notifyChanged, but for mementos, the second wasn't performed.

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

https://invent.kde.org/graphics/krita/-/commit/9e5359d55fc0874f61dcbc4d776ad843689da4c2
Comment 7 wolthera 2026-03-10 17:44:30 UTC
Git commit 3f8687ddb2f8a31bf98552e2e96e81acbb78fcd5 by Wolthera van Hövell.
Committed on 10/03/2026 at 17:44.
Pushed by woltherav into branch 'krita/6.0'.

Make text bulkactions also take into account undo-mementos.

Without this, the text shape thinks it doesn't need to provide
an update rect, leading to rendering errors.


(cherry picked from commit 0c53e851024907560d712c6b0d357a5554359682)

Co-authored-by: Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>

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

https://invent.kde.org/graphics/krita/-/commit/3f8687ddb2f8a31bf98552e2e96e81acbb78fcd5
Comment 8 wolthera 2026-03-10 17:45:02 UTC
Git commit a56954e465951f4fe975ff981ca304f53f19720e by Wolthera van Hövell.
Committed on 10/03/2026 at 17:44.
Pushed by woltherav into branch 'krita/6.0'.

Fix updating text from undo info.

KoShapes need both be updated with updateAbsolute as well as
notifyChanged, but for mementos, the second wasn't performed.


(cherry picked from commit 9e5359d55fc0874f61dcbc4d776ad843689da4c2)

Co-authored-by: Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>

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

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