I am hiding the character *
by inserting GlyphProperty.null
then calling setGlyphs(_:properties:characterIndexes:font:forGlyphRange:)
inside layoutManager(_:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:)
as described in the answer in https://stackoverflow.com/a/57697139/9568961, it works but after a certain sequence of text editing, the cursor starts to misplace, as shown in the gif https://github.com/dzAtZJU/Demos/blob/master/cursor_misplace.GIF?raw=true
GIF Description: When the second line becomes qq
, I try to move the cursor to the end of first line, but it move directly to the beginning. I then try to delete characters, then the cursor move to the end correctly.
The sample project is here https://github.com/dzAtZJU/HideText.
Is it a bug? Have anyone run into this? How can I work around this?