From e32077fb0d7eea51d7a83b42af1f4b18981f0365 Mon Sep 17 00:00:00 2001
From: mob-sakai <sakai861104@gmail.com>
Date: Fri, 26 Jan 2024 20:34:59 +0900
Subject: [PATCH] fix: unintended scaling occurs when
 `AutoScalingMode=UIParticle` and `ScalingMode=Local`

close #292
---
 Runtime/UIParticleRenderer.cs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Runtime/UIParticleRenderer.cs b/Runtime/UIParticleRenderer.cs
index 045f997..d1254e6 100644
--- a/Runtime/UIParticleRenderer.cs
+++ b/Runtime/UIParticleRenderer.cs
@@ -515,6 +515,13 @@ namespace Coffee.UIExtensions
         {
             Profiler.BeginSample("[UIParticleRenderer] GetWorldScale");
             var scale = _parent.scale3DForCalc.GetScaled(_parent.parentScale);
+
+            if (_parent.autoScalingMode == UIParticle.AutoScalingMode.UIParticle
+                && _particleSystem.main.scalingMode == ParticleSystemScalingMode.Local)
+            {
+                scale = scale.GetScaled(_parent.canvas.transform.localScale);
+            }
+
             Profiler.EndSample();
             return scale;
         }