fix(layout): add top-level corner mask overlay
This commit is contained in:
@@ -2191,6 +2191,11 @@ namespace C4IT_CustomerPanel
|
||||
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius);
|
||||
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);
|
||||
|
||||
if (MainWindowCornerMaskOverlay != null)
|
||||
{
|
||||
MainWindowCornerMaskOverlay.Data = CreateCornerOverflowMaskGeometry(surfaceWidth, surfaceHeight, surfaceRadius);
|
||||
}
|
||||
|
||||
if (btnSP != null && btnSP.ActualWidth > 0d && btnSP.ActualHeight > 0d)
|
||||
{
|
||||
btnSP.Clip = CreateBottomRoundedRectGeometry(btnSP.ActualWidth, btnSP.ActualHeight, contentRadius);
|
||||
@@ -2224,6 +2229,22 @@ namespace C4IT_CustomerPanel
|
||||
return geometry;
|
||||
}
|
||||
|
||||
private static Geometry CreateCornerOverflowMaskGeometry(double width, double height, double radius)
|
||||
{
|
||||
if (width <= 0d || height <= 0d)
|
||||
return Geometry.Empty;
|
||||
|
||||
double r = Math.Max(0d, Math.Min(radius, Math.Min(width / 2d, height / 2d)));
|
||||
if (r <= 0d)
|
||||
return Geometry.Empty;
|
||||
|
||||
var fullRect = new RectangleGeometry(new Rect(0d, 0d, width, height));
|
||||
var roundedRect = new RectangleGeometry(new Rect(0d, 0d, width, height), r, r);
|
||||
var mask = new CombinedGeometry(GeometryCombineMode.Exclude, fullRect, roundedRect);
|
||||
mask.Freeze();
|
||||
return mask;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class cMainFunctionInfo
|
||||
|
||||
Reference in New Issue
Block a user