Skip to content

Fix rounded shape containment during clip discard - #988

Merged
Kyle-Ye merged 1 commit into
mainfrom
bugfix/position
Aug 13, 2026
Merged

Kyle-Ye merged 1 commit into
mainfrom
bugfix/position

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Aug 13, 2026

Copy link
Copy Markdown
Member

Background

This issue was found while validating the not-yet-merged JindoKitOpenSwiftUIContentView.

In its minimal Dynamic Island presentation, the symbol was positioned correctly,
but the capsule background was rendered at the top-left corner. The example code
is not included in this pull request.

The rounded shape was being tested using its rectangular bounding box. Because
the bounding box corners extend outside an equivalent rounded clip, the clip was
incorrectly retained. This introduced an unnecessary inherited rendering
boundary and caused the shape to lose its accumulated position.

Changes

  • Preserve rounded shape geometry when checking whether a clip fully contains
    display-list content.
  • Keep rectangular content on the existing rectangle-containment path.
  • Clamp rounded-corner containment using the rectangle’s shortest dimension.
  • Recheck swapped clip entries after removing a redundant clip.
  • Add regression coverage for non-square rounded rectangles.

@github-actions github-actions Bot added area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. impact: visual-diff Visual mismatch, screenshot diff, or rendering fidelity issue. type: bug Something is not working correctly. labels Aug 13, 2026
@Kyle-Ye
Kyle-Ye merged commit dd0da86 into main Aug 13, 2026
5 of 8 checks passed
@Kyle-Ye
Kyle-Ye deleted the bugfix/position branch August 13, 2026 17:28
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.00000% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.61%. Comparing base (f36a53c) to head (d6a06d0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...Core/Render/DisplayList/DisplayListViewModel.swift 0.00% 27 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #988      +/-   ##
==========================================
- Coverage   14.62%   14.61%   -0.01%     
==========================================
  Files         690      690              
  Lines       47762    47773      +11     
==========================================
  Hits         6984     6984              
- Misses      40778    40789      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tuist

tuist Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Cache hit rate Tests Skipped Ran Commit
OpenSwiftUI ❌ 0 % 1013 0 1013 c7627a1a1

Failed Tests ❌

  • OpenSwiftUI: 6 failed tests (View all)

  • optionalViewAliasUsage(sourceIsPresent:) · OpenSwiftUITests · ViewAliasTests
    (displayList → "(display-list (item #:identity 2 #:version 6 (frame (0.0 0.0; 100.0 100.0)) (content-seed 11) (color #000000FF)))").contains(effec…

  • optionalViewAliasConsumerTracksPresentAndNilSource() · OpenSwiftUITests · ViewAliasTests
    (presentDisplayList → "(display-list (item #:identity 4 #:version 10 (frame (0.0 0.0; 100.0 100.0)) (content-seed 19) (color #000000FF)))").contai…

  • optionalViewAliasDynamicProperty() · OpenSwiftUITests · ViewAliasTests
    (displayList → "(display-list (item #:identity 9 #:version 18 (frame (0.0 0.0; 100.0 100.0)) (content-seed 35) (color #000000FF)))").contains(effe…

  • nestedMultiViewRoot() · OpenSwiftUICoreTests · VariadicViewTests
    (displayList.description → "(display-list (item #:identity 14 #:version 1012 (frame (0.0 0.0; 100.0 100.0)) (content-seed 2023) (color #FF3B30FF))…

  • nestedUnaryViewRoot() · OpenSwiftUICoreTests · VariadicViewTests
    (displayList.description → "(display-list (item #:identity 7 #:version 1009 (frame (0.0 0.0; 100.0 100.0)) (effect (item #:identity 10 #:version…

Showing 5 of 6 failed tests. See links above for full details.

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 1m 5s c7627a1a1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. impact: visual-diff Visual mismatch, screenshot diff, or rendering fidelity issue. type: bug Something is not working correctly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant