Skip to content

Fix squashed rendering on iOS (safe-area surface size mismatch) - #735

Merged
nicoburns merged 1 commit into
mainfrom
devin/1786973585-ios-safe-area-render
Aug 17, 2026
Merged

nicoburns merged 1 commit into
mainfrom
devin/1786973585-ios-safe-area-render

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

On iOS the rendered content appeared vertically squashed. The root cause was a size mismatch between the document viewport and the render surface: SurfaceResized already sets the document viewport to surface_size - safe_area_insets (and with_viewport sizes the renderer at viewport + insets), but the initial View::init viewport and resume/complete_resume used inconsistent sizes. The wgpu surface ended up configured at the inset-adjusted height while covering the full window, so Vello's output was stretched/squashed to fit.

Fix (all in blitz-shell/src/window.rs):

  • init: create the initial Viewport at surface_size - safe_area_insets instead of the full surface size, matching what SurfaceResized later computes.
  • resume/complete_resume: size the render surface at viewport + insets (the full window), matching with_viewport.
  • complete_resume/redraw: pass physical insets to paint_scene instead of insets.to_logical(scale)initial_x/initial_y are consumed as physical pixels (see the unit note in debug_overlay.rs), so logical values placed content under the notch on 3x displays.

Also in blitz-paint/src/render.rs: the background rect used initial_x * scale, double-scaling the already-physical offset; now uses initial_x/initial_y directly, consistent with the element transform path.

No behavior change on platforms with zero safe-area insets (including macOS, where insets are hardcoded to zero).

Verified on an iPhone 17 simulator (3x scale, insets top=186/bottom=102 physical):

Before After
before after

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/4cdd57b070834fc8af874a8aed768c65
Requested by: @nicoburns

WPT results

No changes in test results compared to main.

Generated by the WPT workflow.

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nicoburns
nicoburns merged commit 5ce6682 into main Aug 17, 2026
15 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.

1 participant