Skip to content

fix: round subpixel coordinates for glyph background rectangles - #892

Merged
mmstick merged 1 commit into
pop-os:masterfrom
Connor-GH:cell-borders
Jul 31, 2026
Merged

mmstick merged 1 commit into
pop-os:masterfrom
Connor-GH:cell-borders

Conversation

@Connor-GH

Copy link
Copy Markdown

cosmic-term currently has an issue where borders appear to separate some cells columnwise. This was caused due to the accumulation of floating point error when using font sizes that can't be fully represented in an f32. For example, a font size of 8.4x20 and a unique color per cell is enough to reproduce this. Essentially, the glyph background rectangles are being drawn slightly too narrow, causing the terminal background to leak through. This patch rounds the rectangles in such a way that we guarantee the drawing of that "border" pixel using floor() and ceil().

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

`cosmic-term` currently has an issue where borders appear to separate
some cells columnwise. This was caused due to the accumulation of
floating point error when using font sizes that can't be fully
represented in an f32. For example, a font size of 8.4x20 and a unique
color per cell is enough to reproduce this. Essentially, the glyph
background rectangles are being drawn slightly too narrow, causing the
terminal background to leak through. This patch rounds the rectangles in
such a way that we guarantee the drawing of that "border" pixel using
floor() and ceil().
@jackpot51
jackpot51 requested review from a team July 29, 2026 21:00
@mmstick
mmstick merged commit 7daf10e into pop-os:master Jul 31, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants