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

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
@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
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 27, 2026
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.

Co-authored-by: Alexandru Dima <alex.dima@outlook.com>
(cherry picked from commit 7d0a3d7)
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

7 participants