fix(layout): enforce 1px inner inset for rounded frame

This commit is contained in:
Meik
2026-03-05 16:54:03 +01:00
parent 0b4f5f3d70
commit d411f23fc4
3 changed files with 5 additions and 16 deletions

View File

@@ -2184,28 +2184,16 @@ namespace C4IT_CustomerPanel
const double surfaceRadius = 20d;
const double contentRadius = 19d;
double contentInset = Math.Max(0d, MainWindowSurface.BorderThickness.Left);
MainGrid.Clip = null;
this.Clip = null;
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius);
double clippedContentWidth = Math.Max(0d, contentWidth - (contentInset * 2d));
double clippedContentHeight = Math.Max(0d, contentHeight - (contentInset * 2d));
double clippedContentRadius = Math.Max(0d, contentRadius - contentInset);
if (clippedContentWidth > 0d && clippedContentHeight > 0d)
{
MainWindowContentRoot.Clip = new RectangleGeometry(
new Rect(contentInset, contentInset, clippedContentWidth, clippedContentHeight),
clippedContentRadius,
clippedContentRadius);
}
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);
if (btnSP != null && btnSP.ActualWidth > 0d && btnSP.ActualHeight > 0d)
{
btnSP.Clip = CreateBottomRoundedRectGeometry(btnSP.ActualWidth, btnSP.ActualHeight, surfaceRadius);
btnSP.Clip = CreateBottomRoundedRectGeometry(btnSP.ActualWidth, btnSP.ActualHeight, contentRadius);
}
_mainSurfaceClipInitialized = true;