Skip to content

Commit

Permalink
Merge pull request #2 from cnbluefire/fix-hostbackdrop
Browse files Browse the repository at this point in the history
修复 HostBackdrop 靠近屏幕边缘时出现半透明的问题
  • Loading branch information
wherewhere committed Apr 21, 2024
2 parents 78a1be0 + e390993 commit b292bea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
22 changes: 16 additions & 6 deletions MicaForUWP/Media/BackdropBlurBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,23 @@ protected override void OnConnected()
MultiplyAmount = 0f,
Source1Amount = (float)(1f - TintOpacity),
Source2Amount = (float)TintOpacity,
Source1 = new GaussianBlurEffect
Source1 = new CompositeEffect
{
Name = "Blur",
BlurAmount = (float)Amount,
BorderMode = EffectBorderMode.Hard,
Optimization = EffectOptimization.Balanced,
Source = new CompositionEffectSourceParameter("backdrop"),
Sources =
{
new ColorSourceEffect
{
Color = Colors.Black,
},
new GaussianBlurEffect
{
Name = "Blur",
BlurAmount = (float)Amount,
BorderMode = EffectBorderMode.Hard,
Optimization = EffectOptimization.Balanced,
Source = new CompositionEffectSourceParameter("backdrop"),
}
}
},
Source2 = new ColorSourceEffect
{
Expand Down
4 changes: 2 additions & 2 deletions MicaForUWP/MicaForUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22621.2428" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22621.3233" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows10.0.22000.0'">
<PackageReference Include="Dongle.Windows.CsWinRT" Version="3.0.0-wux.2" />
<PackageReference Include="Dongle.WindowsSDK.NET" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
Expand Down
2 changes: 1 addition & 1 deletion MicaForUWP/Properties/MicaForUWP.rd.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
This file enables reflection for 'UnicodeStyle' and all of its public/private members.
This file enables reflection for 'MicaForUWP' and all of its public/private members.
Thus, making the library to work in .NET Native, even if developers modified their default rd.xml.
See issue https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/3093 for more details.
-->
Expand Down

0 comments on commit b292bea

Please sign in to comment.