Post

Replies

Boosts

Views

Activity

How to apply affine transformation to a gradient itself in swiftUI
Rectangle() .fill( RadialGradient.radialGradient( colors: [.blue, .yellow], center: UnitPoint(x:0.5, y:0.5), startRadius: 0, endRadius: 50) ) .frame(width: 100, height: 100) In the above code I have a Rectangle with simple radial gradient as follow: I wanna apply an arbitrary transformation matrix to the gradient so I can achieve following effects: I tried following.. but it applying the transformation matrix to frame instead of shader/gradient Rectangle() .overlay( RadialGradient.radialGradient( colors: [.blue, .yellow], center: UnitPoint(x:0.5, y:0.5), startRadius: 0, endRadius: 50) .transformEffect( CGAffineTransform( -0.5000000596046448, 0.4999999403953552, -0.972577691078186, -0.9725777506828308, 0.5000000596046448, 1.4725778102874756) .translatedBy(x: -50, y: -100) ) ) .frame(width: 100, height: 100) it result in transformation of frame intreat of shader/gradient: Thanks in advance 🙌🏻
1
0
772
Jul ’23
NSOutlineView (Multiple Selection): How to prevent Child Row Deselection on Collapse
I’ve enabled multiple selection in NSOutlineView. When I collapse a parent item, all of its selected child rows get deselected automatically. Is there a way to prevent this deselection so that selections remain intact when the parent is collapsed and restored when it’s expanded again?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
1
Boosts
0
Views
105
Activity
Oct ’25
How to apply affine transformation to a gradient itself in swiftUI
Rectangle() .fill( RadialGradient.radialGradient( colors: [.blue, .yellow], center: UnitPoint(x:0.5, y:0.5), startRadius: 0, endRadius: 50) ) .frame(width: 100, height: 100) In the above code I have a Rectangle with simple radial gradient as follow: I wanna apply an arbitrary transformation matrix to the gradient so I can achieve following effects: I tried following.. but it applying the transformation matrix to frame instead of shader/gradient Rectangle() .overlay( RadialGradient.radialGradient( colors: [.blue, .yellow], center: UnitPoint(x:0.5, y:0.5), startRadius: 0, endRadius: 50) .transformEffect( CGAffineTransform( -0.5000000596046448, 0.4999999403953552, -0.972577691078186, -0.9725777506828308, 0.5000000596046448, 1.4725778102874756) .translatedBy(x: -50, y: -100) ) ) .frame(width: 100, height: 100) it result in transformation of frame intreat of shader/gradient: Thanks in advance 🙌🏻
Replies
1
Boosts
0
Views
772
Activity
Jul ’23