Refine rounded clip inset to keep content within all corners
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user