Skip to content

Commit

Permalink
feat: avalonia 0.9 -> 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gosha20777 committed Feb 17, 2021
1 parent cf6d0c4 commit 5a6a5bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 7 additions & 9 deletions src/LacmusApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.9.12" />
<PackageReference Include="Avalonia" Version="0.10.0" />
<PackageReference Include="Avalonia.Angle.Natives" Version="2.0.0" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.9.12" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="2.3.2" />
<PackageReference Include="Avalonia.Desktop" Version="0.9.12" />
<PackageReference Include="Avalonia.Native" Version="0.9.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.12" />
<PackageReference Include="Avalonia.Skia.Linux.Natives" Version="1.68.0.2" />
<PackageReference Include="Citrus.Avalonia" Version="1.2.6" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.0" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="3.0.0" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.0" />
<PackageReference Include="Avalonia.Native" Version="0.10.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.0" />
<PackageReference Include="Citrus.Avalonia" Version="1.4.3" />
<PackageReference Include="Docker.DotNet" Version="3.125.2" />
<PackageReference Include="Material.Avalonia" Version="0.9.0" />
<PackageReference Include="MessageBox.Avalonia" Version="0.9.6.1" />
<PackageReference Include="MetadataExtractor" Version="2.4.3" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="3.1.6" />
Expand Down
8 changes: 5 additions & 3 deletions src/Models/Zoomer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ public class Zoomer
public static void Init(ZoomBorder zoomBorder)
{
_zoomBorder = zoomBorder;
_zoomBorder.PanButton = ButtonName.Left;
_zoomBorder.EnablePan = true;
}

public static void Zoom(double scale)
{
_zoomBorder?.ZoomTo(scale, 0, 0);
_zoomBorder?.ZoomTo(scale, 0, 0, false);
}

public static void MoveTo(double x, double y)
{
/* Thanks to @wieslawsoltes https://github.com/wieslawsoltes/PanAndZoom/issues/27 */
_zoomBorder?.StartPan(0,0);
_zoomBorder?.PanTo(x,y);
_zoomBorder?.Pan(0,0, false);
_zoomBorder?.PanDelta(x,y, false);
}

public static double GetZoomX()
Expand Down
2 changes: 1 addition & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.IO;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Logging.Serilog;
using Avalonia.Logging;
using Avalonia.ReactiveUI;
using Avalonia.Rendering;
using LacmusApp.Models;
Expand Down

1 comment on commit 5a6a5bb

@gosha20777
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.