You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to Bevy 0.15, this solution was necessary, because it was impossible to accurately determine the "physical" position of the cursor due to limitations in ab_glyph. (Er, seems that we're blocked on 0.16)
We should be able to do something less crazy for a cursor now.
We could either
Use cosmic-text's Editor for cursor management (and buffer manipulation)
This is arguably "not simple." and we may want to wait for improvements in cosmic-text. The buffer / editor juggling that needs to be done is pretty nasty. But it could potentially simplify other sections of code.
Uh oh!
There was an error while loading. Please reload this page.
Prior to Bevy 0.15, this solution was necessary, because it was impossible to accurately determine the "physical" position of the cursor due to limitations in
ab_glyph
. (Er, seems that we're blocked on 0.16)We should be able to do something less crazy for a cursor now.
We could either
Use
cosmic-text
'sEditor
for cursor management (and buffer manipulation)The cosmic text design that landed in Bevy 0.15 didn't include a way to access the cosmic buffer. After Bevy 0.16, it might be possible to do this again thanks to CosmicBuffer is a public type but not not used or accessible in any public API bevyengine/bevy#17748.
This is arguably "not simple." and we may want to wait for improvements in cosmic-text. The buffer / editor juggling that needs to be done is pretty nasty. But it could potentially simplify other sections of code.
See cosmic changes #74 (comment)
And Save and resume editor state / handle external pop-os/cosmic-text#285.
Look up the cursor position in
TextLayoutInfo
now that it is more reliable.Note that
PositionedGlyph
'ssize
refers to the size of the glyph texture, which is not what we want, especially for space characters.After Bevy 0.16, it will be possible to get the correct width value from the cosmic buffer. (though it is tedious to do so)
And draw the cursor as a simple colored
Node
. (This can/should be a temporaryExtractedNode
in the render world)The text was updated successfully, but these errors were encountered: