fix(layout): inset content clip inside rounded border
This commit is contained in:
@@ -2184,12 +2184,24 @@ 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);
|
||||
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (btnSP != null && btnSP.ActualWidth > 0d && btnSP.ActualHeight > 0d)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user