Skip to content

android, desktop: constrain image height in layout#6959

Merged
epoberezkin merged 2 commits into
masterfrom
nd/fix-image-text-overlap
May 12, 2026
Merged

android, desktop: constrain image height in layout#6959
epoberezkin merged 2 commits into
masterfrom
nd/fix-image-text-overlap

Conversation

@Narasimha-sc
Copy link
Copy Markdown
Collaborator

@Narasimha-sc Narasimha-sc commented May 9, 2026

Tall image previews (height > 2.33 × width) overlapped the caption — Compose's aspectRatio couldn't satisfy both .width(W) and PriorityLayout's height cap, fell through to unbounded constraints, and the inner Image overflowed its layout box. Clamping with .coerceAtLeast(1f / 2.33f) keeps the ratio in the range Compose can satisfy, so the layout stays bounded and clipToBounds crops the painter cleanly. Analogous to iOS #6732.

Clamp the image preview Box's aspect ratio so it never goes
below 1/2.33 (matching the height cap already enforced by
PriorityLayout). Prevents tall image previews from overflowing
into the caption area below.

Analogous to iOS #6732.
@Narasimha-sc Narasimha-sc requested a review from epoberezkin as a code owner May 9, 2026 19:38
@epoberezkin epoberezkin merged commit 1f25cec into master May 12, 2026
1 of 2 checks passed
@epoberezkin epoberezkin deleted the nd/fix-image-text-overlap branch May 12, 2026 15:48
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants