Jelajahi Sumber

Inverted the ClipRectangle logic

Jean-David Moisan 6 tahun lalu
induk
melakukan
46c3be3ea1
3 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 1 1
      Source/Component.cs
  2. 1 1
      Source/LayoutVertical.cs
  3. 1 1
      Source/LayoutVerticalCenter.cs

+ 1 - 1
Source/Component.cs

@@ -191,7 +191,7 @@ namespace Apos.Gui {
         public Rectangle ClipRectangle(Rectangle rect1) {
             //TODO: Change the API so that this is done against this component's clipping rect.
             //      This implies that this function is called against the parent and not the child.
-            return ClipRectangle(rect1, BoundingRect);
+            return ClipRectangle(rect1, ClippingRect);
         }
         /// <summary>
         /// Checks if a point is within this component's bounding rectangle.

+ 1 - 1
Source/LayoutVertical.cs

@@ -24,7 +24,7 @@ namespace Apos.Gui {
                 c.Height = cHeight;
                 c.Position = new Point(position.X, offsetY + position.Y) + Panel.Offset;
                 offsetY += cHeight;
-                c.ClippingRect = c.ClipRectangle(Panel.ClippingRect);
+                c.ClippingRect = Panel.ClipRectangle(c.BoundingRect);
             }
             Panel.Size = new Size2(width, offsetY);
         }

+ 1 - 1
Source/LayoutVerticalCenter.cs

@@ -58,7 +58,7 @@ namespace Apos.Gui {
                     c.Position = new Point(position.X + halfWidth - componentHalfWidth, offsetY) + Panel.Offset;
                 }
                 offsetY += cHeight;
-                c.ClippingRect = c.ClipRectangle(Panel.ClippingRect);
+                c.ClippingRect = Panel.ClipRectangle(c.BoundingRect);
             }
             Panel.Size = new Size2(canvasWidth, canvasHeight);
         }