gpui: Fix rounded corners on images with object-fit cover - #59300
Closed
J0R6IT0 wants to merge 3 commits into
Closed
gpui: Fix rounded corners on images with object-fit cover#59300J0R6IT0 wants to merge 3 commits into
J0R6IT0 wants to merge 3 commits into
Conversation
Contributor
Author
|
Hi, looks good to me too. Each implementation has its advantages, so the Zed team will have to choose the one they prefer. |
Author
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.

Objective
roundeddid not work properly on images usingObjectFit::Cover. The image is scaled to be larger than the element so it can cover the bounds, and the overflow was clipped to a plain rectangle, so the rounded corners were applied to the oversized image quad, outside the visible element box. FIxes #44339.Solution
PolychromeSpritenow carries aclip_boundsfield in addition tobounds, that shaders use to round and clip.Done in all three renderers.
Testing
object_fitexample to showcase the differentObjectFitoptions and aspect ratios.Self-Review Checklist:
Showcase
BEFORE:

AFTER:

Release Notes: