Repository navigation
fix(android): correct cover-fill scaling in SinkSurface vertices - #249
Merged
parkergrt merged 1 commit intoSep 26, 2026
Merged
Conversation
FillMode::PreserveAspectRatioAndFill computed scaled_width from view_width_ / inset_framebuffer_height and scaled_height from view_height_ / inset_framebuffer_width — each axis divided by the other axis's extent, which is not a scale factor. On a portrait preview the content rendered pillarboxed (e.g. ~608px inside a 1080px view) instead of filling and cropping. Compute a single uniform cover factor and apply it on both axes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
SinkSurface::UpdateDisplayVertices,FillMode::PreserveAspectRatioAndFillcomputesscaled_width = view_width_ / inset_framebuffer_heightandscaled_height = view_height_ / inset_framebuffer_width— each axis divided by the other axis's extent, which is not a scale factor. On a portrait preview the content renders pillarboxed (e.g. ~608px inside a 1080px view) instead of filling and cropping.Fix
Compute a single uniform cover factor (
maxof the per-axis fits) and apply it on both axes, so the content scales up until it spans the view and the long axis crops — which is what cover-fill means. TheFitCenterbranch is unchanged.Verified on Android: preview fills the full view width with correct aspect and cropping.