fix(layout): enforce 1px inner inset for rounded frame
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user