Browse Source

Fixed scaling and center

Krzysztof Krysiński 1 year ago
parent
commit
5caaef2ee2

+ 1 - 1
src/PixiEditor.Tests/PixiEditor.Tests.csproj

@@ -11,7 +11,7 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Avalonia" Version="11.0.4" />
+        <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
         <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
         <PackageReference Include="xunit" Version="2.4.2"/>
         <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">

+ 2 - 2
src/PixiEditor.Zoombox/Zoombox.axaml

@@ -36,8 +36,8 @@
                         ScaleY="{Binding ElementName=uc, Path=FlipTransformY}" />
                 </TransformGroup>
             </Grid.RenderTransform>
-            <ContentPresenter
-                Content="{Binding AdditionalContent, ElementName=uc}" />
+            <ContentPresenter RenderTransformOrigin="0.5,0.5"
+                              Content="{Binding AdditionalContent, ElementName=uc}" />
         </Grid>
     </Canvas>
 </UserControl>

+ 1 - 1
src/PixiEditor.Zoombox/Zoombox.axaml.cs

@@ -292,7 +292,7 @@ public partial class Zoombox : UserControl, INotifyPropertyChanged
         FlipX = false;
         FlipY = false;
         Scale = 1 / scaleFactor;
-        Center = newSize / 2 * scaleFactor;
+        Center = newSize / 2;
     }
 
     public void ZoomIntoCenter(double delta)