Skip to content

Commit

Permalink
fix: soft masked image flickers or disappears when resizing canvas in…
Browse files Browse the repository at this point in the history
… editor

close #184
  • Loading branch information
mob-sakai committed Aug 16, 2024
1 parent 82772a8 commit d5568b8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Packages/src/Runtime/SoftMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,24 @@ protected override void OnValidate()
{
base.OnValidate();
AddSoftMaskableOnChildren();
SetDirtyAndNotify();
SetSoftMaskDirty();
UpdateAntiAlias();

if (graphic)
{
graphic.SetVerticesDirty();
}

var list = ListPool<IMaskable>.Rent();
GetComponents(list);
for (var i = 0; i < list.Count; i++)
{
if (list[i] == null) continue;

list[i].RecalculateMasking();
}

ListPool<IMaskable>.Return(ref list);
}
#endif

Expand Down

0 comments on commit d5568b8

Please sign in to comment.