Skip to content

[Bug] DL container mismatch for rotationEffect #578

@Kyle-Ye

Description

@Kyle-Ye

The DL is not aligned currently:

struct ContentView: View {
    var body: some View {
        VStack {
            Color.yellow
                .frame(width: 100, height: 100, alignment: .center)
                .zIndex(1)
            Color.red
                .frame(width: 100, height: 100, alignment: .center)
                .rotationEffect(.degrees(45))
        }
    }
SwiftUI
(display-list
  (item #:identity 4 #:version 11
    (frame (50.0 104.0; 100.0 100.0))
    (effect
      (transform rotation(SwiftUI._RotationEffect.Data(angle: SwiftUI.Angle(radians: 0.7853981633974483), anchor: (50.0, 50.0))))
      (item #:identity 3 #:version 10
        (frame (0.0 0.0; 100.0 100.0))
        (content-seed 21)
        (color #FF3B30FF))))
  (item #:identity 2 #:version 12
    (frame (50.0 -4.0; 100.0 100.0))
    (content-seed 25)
    (color #FFCC00FF)))

OpenSwiftUI
(display-list
  (item #:identity 4 #:version 2
    (frame (0.0 104.0; 200.0 96.0))
    (effect
      (transform rotation(SwiftUI._RotationEffect.Data(angle: SwiftUI.Angle(radians: 0.7853981633974483), anchor: (100.0, 48.0))))
      (item #:identity 2 #:version 1
        (frame (50.0 -2.0; 100.0 100.0))
        (content-seed 3)
        (color #FF3B30FF))))
  (item #:identity 1 #:version 3
    (frame (50.0 -2.0; 100.0 100.0))
    (content-seed 7)
    (color #FFCC00FF)))

Originally posted by @Kyle-Ye in #576 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions