Skip to content

Round custom line heights - #298421

Merged
Alexandru Dima (alexdima) merged 3 commits into
microsoft:mainfrom
remcohaszing:fix-scroll-wobble
Aug 28, 2026
Merged

Round custom line heights#298421
Alexandru Dima (alexdima) merged 3 commits into
microsoft:mainfrom
remcohaszing:fix-scroll-wobble

Conversation

@remcohaszing

Copy link
Copy Markdown
Contributor

In most calculations within VSCode when dealing with line heights, integer values are used. However, custom line heights via decorations introduce floats. These floats end up in the CSS used to render lines. As a result, this causes a wobble effect when scrolling.

This change fixes it, by rounding custom line height values.

Fixes #296539

In most calculations within VSCode when dealing with line heights,
integer values are used. However, custom line heights via decorations
introduce floats. These floats end up in the CSS used to render lines.
As a result, this causes a wobble effect when scrolling.

This change fixes it, by rounding custom line height values.
@alexdima
Alexandru Dima (alexdima) enabled auto-merge (squash) August 26, 2026 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Rounds custom decoration-provided line heights to integers to avoid fractional CSS values that can cause visual “wobble” while scrolling.

Changes:

  • Round specialHeight when constructing CustomLine
  • Round maximumSpecialHeight to keep related height values integer-aligned
Show a summary per file
File Description
src/vs/editor/common/viewLayout/lineHeights.ts Ensures custom line heights are stored as integers by rounding incoming decoration heights

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/vs/editor/common/viewLayout/lineHeights.ts
@alexdima
Alexandru Dima (alexdima) merged commit 7d0a3d7 into microsoft:main Aug 28, 2026
44 of 45 checks passed
@remcohaszing
Remco Haszing (remcohaszing) deleted the fix-scroll-wobble branch August 28, 2026 12:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 28, 2026
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.

Non-integer custom line height decorations make text wobbly while scrolling

7 participants