Refine rounded clip inset to keep content within all corners

This commit is contained in:
Meik
2026-03-05 15:33:27 +01:00
parent ac427c2c72
commit c59ab2c237
2 changed files with 11 additions and 2 deletions

View File

@@ -2172,7 +2172,16 @@ namespace C4IT_CustomerPanel
if (width <= 0 || height <= 0)
return;
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0, 0, width, height), 20, 20);
const double outerRadius = 20d;
const double clipInset = 1d;
double clipWidth = Math.Max(0d, width - (clipInset * 2d));
double clipHeight = Math.Max(0d, height - (clipInset * 2d));
double clipRadius = Math.Max(0d, outerRadius - clipInset);
MainWindowSurface.Clip = new RectangleGeometry(
new Rect(clipInset, clipInset, clipWidth, clipHeight),
clipRadius,
clipRadius);
}
}