Skip to content

Fix ComposeViewport canvas overflow at fractional scales - #3389

Merged
Oleksandr Karpovich (eymar) merged 1 commit into
jb-mainfrom
ok/fix_composeviewport_dimensions
Sep 16, 2026
Merged

Oleksandr Karpovich (eymar) merged 1 commit into
jb-mainfrom
ok/fix_composeviewport_dimensions

Conversation

@eymar

@eymar Oleksandr Karpovich (eymar) commented Sep 7, 2026

Copy link
Copy Markdown
Member

Description:
The generated positioning container and its nested containers did not establish a definite sizing chain. As a result, the canvas’s height: 100% could not always resolve against the viewport container, and its rendered CSS size could fall back to the intrinsic aspect ratio derived from the canvas.width and canvas.height backing-store attributes.

At fractional display scales, independently rounded backing-store dimensions could make the rendered canvas slightly taller than the viewport container, causing browser scrollbars.

Giving the positioning container and its nested containers explicit dimensions ensures that the canvas’s CSS bounds are determined by the viewport container and remain independent of its backing-store size.


Fixes https://youtrack.jetbrains.com/issue/CMP-10762/Scrollbar-appears-at-some-browser-zoom-levels (see the screenshot of the problem there)

Testing

  • This should be tested by QA
  • Added a new test

Release Notes

N/A

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checked manually, failed to come up with better solution (tried flex and grid approaches)

@eymar
Oleksandr Karpovich (eymar) merged commit 6ce4746 into jb-main Sep 16, 2026
20 checks passed
@eymar
Oleksandr Karpovich (eymar) deleted the ok/fix_composeviewport_dimensions branch September 16, 2026 07:10
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.

2 participants