fix(ui): unify rounded frame rendering and inner content clip
This commit is contained in:
@@ -2172,26 +2172,19 @@ namespace C4IT_CustomerPanel
|
||||
|
||||
private void UpdateMainSurfaceClip()
|
||||
{
|
||||
if (MainWindowSurface == null || MainGrid == null)
|
||||
if (MainWindowSurface == null || MainWindowContentRoot == null || MainGrid == null)
|
||||
return;
|
||||
|
||||
double gridWidth = MainGrid.ActualWidth;
|
||||
double gridHeight = MainGrid.ActualHeight;
|
||||
if (gridWidth <= 0 || gridHeight <= 0)
|
||||
double contentWidth = MainWindowContentRoot.ActualWidth;
|
||||
double contentHeight = MainWindowContentRoot.ActualHeight;
|
||||
if (contentWidth <= 0 || contentHeight <= 0)
|
||||
return;
|
||||
|
||||
const double outerRadius = 20d;
|
||||
const double surfaceInset = 1d;
|
||||
double surfaceRadius = Math.Max(0d, outerRadius - surfaceInset);
|
||||
const double contentRadius = 19d;
|
||||
|
||||
MainGrid.Clip = new RectangleGeometry(new Rect(0d, 0d, gridWidth, gridHeight), outerRadius, outerRadius);
|
||||
|
||||
double surfaceWidth = MainWindowSurface.ActualWidth;
|
||||
double surfaceHeight = MainWindowSurface.ActualHeight;
|
||||
if (surfaceWidth > 0 && surfaceHeight > 0)
|
||||
{
|
||||
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius);
|
||||
}
|
||||
MainGrid.Clip = null;
|
||||
MainWindowSurface.Clip = null;
|
||||
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);
|
||||
|
||||
_mainSurfaceClipInitialized = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user