You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Adding on to #6344, that solution works in absolute coordinates and isn't very extensible unless you know the exact size of the visual the brush is applied to (if you're trying to achieve a specific effect). WPF & UWP/WinUI split up transforms on brushes into Transform and RelativeTransform to solve this, Transform is equivalent to what's implemented in #6344, RelativeTransform allows applying transforms in (as the name implies) relative coordinates
In both cases, as an separate point, we also need the ability to set the transform origin (for both cases) as using a TranslateTransform is not extensible nor the same thing. WinUI/WPF have the CenterX and CenterY properties on the different Transform types, Avalonia does not.
The transform is applying at (0,0) of the visual the brush is applied on, which essentially flips the gradient in place and is leading to the incorrect behavior.
A simple solution, if not wanting to adopt the WPF/WinUI API, might be to follow existing RenderTransform/RenderTransformOrigin and add a GradientTransformOrigin property that is a RelativePoint and automatically determine relative vs. absolute.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Adding on to #6344, that solution works in absolute coordinates and isn't very extensible unless you know the exact size of the visual the brush is applied to (if you're trying to achieve a specific effect). WPF & UWP/WinUI split up transforms on brushes into
Transform
andRelativeTransform
to solve this,Transform
is equivalent to what's implemented in #6344,RelativeTransform
allows applying transforms in (as the name implies) relative coordinatesIn both cases, as an separate point, we also need the ability to set the transform origin (for both cases) as using a TranslateTransform is not extensible nor the same thing. WinUI/WPF have the
CenterX
andCenterY
properties on the different Transform types, Avalonia does not.See the following brush from WinUI:
In Avalonia:
Which produces the following:
The transform is applying at (0,0) of the visual the brush is applied on, which essentially flips the gradient in place and is leading to the incorrect behavior.
A simple solution, if not wanting to adopt the WPF/WinUI API, might be to follow existing
RenderTransform
/RenderTransformOrigin
and add aGradientTransformOrigin
property that is aRelativePoint
and automatically determine relative vs. absolute.The text was updated successfully, but these errors were encountered: