fix(ui): enforce continuous rounded window corners
This commit is contained in:
@@ -353,7 +353,7 @@
|
||||
</shell:WindowChrome.WindowChrome>
|
||||
|
||||
<Grid x:Name="MainGrid"
|
||||
Background="{DynamicResource backgroundColor}">
|
||||
Background="Transparent">
|
||||
<Border x:Name="MainWindowSurface"
|
||||
CornerRadius="20"
|
||||
BorderThickness="0"
|
||||
|
||||
@@ -2172,25 +2172,27 @@ namespace C4IT_CustomerPanel
|
||||
|
||||
private void UpdateMainSurfaceClip()
|
||||
{
|
||||
if (MainWindowSurface == null)
|
||||
if (MainWindowSurface == null || MainGrid == null)
|
||||
return;
|
||||
|
||||
double width = MainWindowSurface.ActualWidth;
|
||||
double height = MainWindowSurface.ActualHeight;
|
||||
double width = MainGrid.ActualWidth;
|
||||
double height = MainGrid.ActualHeight;
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
const double outerRadius = 20d;
|
||||
const double clipInset = 0.5d;
|
||||
const double clipInset = 0d;
|
||||
double clipWidth = Math.Max(0d, width - (clipInset * 2d));
|
||||
double clipHeight = Math.Max(0d, height - (clipInset * 2d));
|
||||
double clipRadius = Math.Max(0d, outerRadius - clipInset);
|
||||
|
||||
MainWindowSurface.Clip = new RectangleGeometry(
|
||||
RectangleGeometry clipGeometry = new RectangleGeometry(
|
||||
new Rect(clipInset, clipInset, clipWidth, clipHeight),
|
||||
clipRadius,
|
||||
clipRadius);
|
||||
|
||||
MainGrid.Clip = clipGeometry;
|
||||
MainWindowSurface.Clip = clipGeometry.Clone();
|
||||
|
||||
_mainSurfaceClipInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user