Ignoring singular matrix, should I concerning/Ignoring to this console massage in SwiftUI?
Asked Answered
E

2

11

When I am using rotation3DEffect some times the vale became 90 or -90 degree which what I planed for that, as soon as my degree hit the 90 or -90, I see a massage in console like this:

ignoring singular matrix: ProjectionTransform(m11: 1.0, m12: 0.0, m13: 0.0, m21: -0.125, m22: -0.25, m23: -0.0025, m31: 12.5, m32: 125.0, m33: 1.25)

Which I know it is because of 90 or -90 degree, I like to know should I be responsive to this massage or simply ignoring it? with this in mind that my app has no issue with getting 90 or -90.

code for recreating the massage:

    struct ContentView: View {
    var body: some View {

        Rectangle()
            .fill(Color.red)
            .frame(width: 100, height: 200, alignment: .center)
            .rotation3DEffect(
                Angle(degrees: 90),
                axis: (x: 1.0, y: 0.0, z: 0.0),
                anchor: .center,
                anchorZ: 0.0,
                perspective: 0.5)

    }
}
Extempore answered 3/2, 2021 at 16:13 Comment(0)
R
1

I fixed this by setting z in axis to 0.01

Recant answered 24/4, 2022 at 7:5 Comment(3)
That is not a fix, also I mentioned this answer in my comments.Extempore
Sure, it doesn't fix the underlying library issue -- but it does silence the annoying warning.Cambria
@TrentM.: Which part of l mentioned it in my comments was unclear for you to grab? If l mentioned this way! It means l know it silence the logs!Extempore
T
0

This works for me

I fixed this by setting z in axis to 0.01

.rotation3DEffect(.init(degrees: self.viewModel.animateBottom ? .zero : 90),
                    axis: (1, 0, 0.001),
                    anchor: .top,
                    perspective: 0.3
                )
Tsar answered 8/9, 2024 at 20:38 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.