ソースを参照

Fix preview not getting downsized

Equbuxu 2 年 前
コミット
9974b8bc0b

+ 7 - 0
src/PixiEditor.DrawingApi.Core/Numerics/RectI.cs

@@ -276,6 +276,13 @@ public struct RectI : IEquatable<RectI>
         return ContainsInclusive(rect.TopLeft) && ContainsInclusive(rect.BottomRight);
     }
 
+
+    public readonly bool ContainsExclusive(RectI rect)
+    {
+        return ContainsExclusive(rect.TopLeft) && ContainsExclusive(rect.BottomRight);
+    }
+
+
     public readonly bool ContainsPixel(VecI pixelTopLeft) => ContainsPixel(pixelTopLeft.X, pixelTopLeft.Y);
     public readonly bool ContainsPixel(int pixelTopLeftX, int pixelTopLeftY)
     {

+ 1 - 1
src/PixiEditor/Models/Rendering/MemberPreviewUpdater.cs

@@ -258,7 +258,7 @@ internal class MemberPreviewUpdater
         if (targetLastCollection.TryGetValue(member.GuidValue, out RectI tightBounds))
             prevTightBounds = tightBounds;
 
-        if (prevTightBounds is not null && currentlyAffectedArea.GlobalArea is not null && prevTightBounds.Value.ContainsInclusive(currentlyAffectedArea.GlobalArea.Value))
+        if (prevTightBounds is not null && currentlyAffectedArea.GlobalArea is not null && prevTightBounds.Value.ContainsExclusive(currentlyAffectedArea.GlobalArea.Value))
         {
             // if the affected area is fully inside the previous tight bounds, the tight bounds couldn't possibly have changed
             return prevTightBounds.Value;