Repository navigation
Conversation
On a double-width cell the cursor covered only the left cell: the block tinted one cell and inverted half the glyph, and the hollow and underline sprites were one cell wide. `Crosswords::cursor()` already moves the cursor from a spacer back to the wide cell; it now also reports `wide`. The block cursor passes it to the grid shaders as `cursor_wide` (taking half of the existing uniform padding), so the background tint and the foreground swap cover both columns. Block, hollow and underline sprites, and the trail cursor target, are two cells wide; the bar stays a left-edge stroke. While an IME composition is shown the cursor stays one cell. Fixes raphamorim#1972
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1972
On a double-width cell the cursor covered only the left cell. The block cursor tinted one cell and inverted half the glyph, and the hollow and underline sprites were one cell wide.
Changes:
Crosswords::cursor()already moves the cursor from a spacer back to the wide cell.CursorStatenow also carrieswide.GridUniformsgetscursor_wide, taking half of the existing_pad_cursor, so the size and offsets stay the same (now checked withoffset_of!asserts). The Metal, WGSL, GLSL and CPU paths extend the block cursor's background tint and foreground swap tocursor_pos.x + 1.cursor_sprite_celldraws block, hollow and underline sprites two cells wide. The bar stays a left-edge stroke, as in Ghostty.RenderState::cursor_wide(). The librio C API is unchanged.Note:
CursorStateis public inrio-vt, so code outside this repo that builds it with a struct literal needs the new field.Testing:
cursor()on narrow, wide and spacer cells (rio-vt), sprite widths per style (rio-grid), background tint and foreground swap on both cells (CPU grid), and trail cursor target width.glslc.