Skip to content

Commit

Permalink
fix: Ensure element translation is applied after Loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Dec 6, 2024
1 parent 73de3fd commit 52765aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Uno.UI/UI/Xaml/UIElement.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public partial class UIElement : DependencyObject, IVisualElement, IVisualElemen
private protected ContainerVisual _visual;
private Rect _lastFinalRect;
private Rect? _lastClippedFrame;
private Vector3 _lastTranslation;

public UIElement()
{
Expand Down Expand Up @@ -278,16 +279,21 @@ internal void ArrangeVisual(Rect finalRect, Rect? clippedFrame = default)

var oldFinalRect = _lastFinalRect;
var oldClippedFrame = _lastClippedFrame;
var oldTranslation = _lastTranslation;
_lastFinalRect = finalRect;
_lastClippedFrame = clippedFrame;
_lastTranslation = _translation;

var oldRect = oldFinalRect;
var newRect = finalRect;

var oldClip = oldClippedFrame;
var newClip = clippedFrame;

if (oldRect != newRect || oldClip != newClip || (_renderTransform?.FlowDirectionTransform ?? Matrix3x2.Identity) != GetFlowDirectionTransform())
if (oldRect != newRect ||
oldClip != newClip ||
oldTranslation != _translation ||
(_renderTransform?.FlowDirectionTransform ?? Matrix3x2.Identity) != GetFlowDirectionTransform())
{
if (
newRect.Width < 0
Expand Down

0 comments on commit 52765aa

Please sign in to comment.