Skip to content

Commit

Permalink
fix: flashing when SoftnessRange is changed in inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Jul 24, 2024
1 parent 52916d0 commit d1c6235
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Packages/src/Runtime/SoftMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ private void SetDirtyAndNotifyIfBufferSizeChanged()
{
if (!SoftMaskingEnabled() || !_softMaskBuffer) return;

Logging.Log(this, "SetDirtyAndNotifyIfBufferSizeChanged");
var size = RenderTextureRepository.GetScreenSize((int)downSamplingRate);
var hash = new Hash128((uint)GetInstanceID(), (uint)size.x, (uint)size.y, 0);
if (RenderTextureRepository.Valid(hash, _softMaskBuffer)) return;
Expand All @@ -485,7 +486,6 @@ private void OnBeforeCanvasRebuild()
// SoftMasking mode: If transform or view has changed, set dirty flag.
case MaskingMode.SoftMasking:
{
SetDirtyAndNotifyIfBufferSizeChanged();
if (transform.HasChanged(ref _prevTransformMatrix, UISoftMaskProjectSettings.sensitivity))
{
SetSoftMaskDirty();
Expand Down

0 comments on commit d1c6235

Please sign in to comment.