fix(layout): clamp mainwindow content to rounded corners
This commit is contained in:
@@ -2175,17 +2175,20 @@ namespace C4IT_CustomerPanel
|
||||
if (MainWindowSurface == null || MainWindowContentRoot == null || MainGrid == null)
|
||||
return;
|
||||
|
||||
double surfaceWidth = MainWindowSurface.ActualWidth;
|
||||
double surfaceHeight = MainWindowSurface.ActualHeight;
|
||||
double contentWidth = MainWindowContentRoot.ActualWidth;
|
||||
double contentHeight = MainWindowContentRoot.ActualHeight;
|
||||
if (contentWidth <= 0 || contentHeight <= 0)
|
||||
if (surfaceWidth <= 0 || surfaceHeight <= 0 || contentWidth <= 0 || contentHeight <= 0)
|
||||
return;
|
||||
|
||||
const double surfaceRadius = 20d;
|
||||
const double contentRadius = 19d;
|
||||
|
||||
MainGrid.Clip = null;
|
||||
this.Clip = null;
|
||||
|
||||
MainWindowSurface.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);
|
||||
|
||||
_mainSurfaceClipInitialized = true;
|
||||
|
||||
Reference in New Issue
Block a user