Skip to content

Commit

Permalink
Update TitleBar.WASDK.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 authored Nov 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c0e54a6 commit 3ef7c07
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/TitleBar/src/TitleBar.WASDK.cs
Original file line number Diff line number Diff line change
@@ -152,6 +152,10 @@ public void SetDragRegion(NonClientRegionKind nonClientRegionKind, params Framew

foreach (var frameworkElement in frameworkElements)
{
if (frameworkElement == null)
{
continue;
}
GeneralTransform transformElement = frameworkElement.TransformToVisual(null);
Windows.Foundation.Rect bounds = transformElement.TransformBounds(new Windows.Foundation.Rect(0, 0, frameworkElement.ActualWidth, frameworkElement.ActualHeight));
var transparentRect = new Windows.Graphics.RectInt32(
@@ -162,8 +166,10 @@ public void SetDragRegion(NonClientRegionKind nonClientRegionKind, params Framew
);
rects.Add(transparentRect);
}

nonClientInputSrc.SetRegionRects(nonClientRegionKind, rects.ToArray());
if (rects.Count > 0)
{
nonClientInputSrc.SetRegionRects(nonClientRegionKind, rects.ToArray());
}
}

public void ClearDragRegions(NonClientRegionKind nonClientRegionKind)

0 comments on commit 3ef7c07

Please sign in to comment.