Skip to content

The screenshot has 1 px diff for overlay color on iOS simulator #340

Open
@Kyle-Ye

Description

@Kyle-Ye

The DisplayList is the same.

I suspect this is due to some misalignment on UIHostingView side.

eg.

struct ContentView: View {
    var body: some View {
        ZStack(alignment: .leading) {
            Color.red
                .opacity(0.5)
                .frame(width: 200, height: 200)
        }
        .overlay(alignment: .topLeading) {
            Color.green.opacity(0.5)
                .frame(width: 100, height: 100)
        }
        .background(alignment: .bottomTrailing) {
            Color.blue.opacity(0.5)
                .frame(width: 100, height: 100)
        }
    }
}

The DL is almost identical.

View 0x0000000101d04c90 at Time(seconds: inf):
(display-list
  (item #:identity 3 #:version 1
    (frame (201.0 470.3333333333333; 100.0 100.0))
    (content-seed 3)
    (color #007AFF80))
  (item #:identity 1 #:version 2
    (frame (101.0 370.3333333333333; 200.0 200.0))
    (content-seed 5)
    (color #FF3B3080))
  (item #:identity 2 #:version 3
    (frame (101.0 370.3333333333333; 100.0 100.0))
    (content-seed 7)
    (color #34C75980)))

But the final color pixel of the topLeading image is different.

  • SwiftUI: #99B277FF
  • OpenSwiftUI: #99B278FF

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Low priorityUXproject UX relatedbugSomething isn't workinghelp wantedPR contribution is appreciatedplatform: iOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions