Browse Source

Fixed scene dirty rect and angle

flabbet 1 year ago
parent
commit
50505a36cd

+ 1 - 1
samples/LocalizationSample/Localization/en.json

@@ -1,4 +1,4 @@
 {
   "LOC_SAM:HELLO_WORLD": "Hello World!",
-  "LOC_SAM:HELLO_WORLD_ARGS": "Hello World {0}!"
+  "LOC_SAM:HELLO_NAME": "Hello {0}!"
 }

+ 1 - 1
samples/LocalizationSample/LocalizationSampleExtension.cs

@@ -20,6 +20,6 @@ public class LocalizationSampleExtension : WasmExtension
     public override void OnInitialized()
     {
         Api.Logger.Log(new LocalizedString("LOC_SAM:HELLO_WORLD"));
-        Api.Logger.Log(new LocalizedString("LOC_SAM:HELLO_WORLD_ARGS", "John Doe"));
+        Api.Logger.Log(new LocalizedString("LOC_SAM:HELLO_NAME", "John Doe"));
     }
 }

+ 4 - 12
src/PixiEditor.AvaloniaUI/Views/Rendering/Scene.cs

@@ -120,21 +120,13 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
         if (Surface == null || Document == null) return;
 
         float angle = (float)MathUtil.RadiansToDegrees(AngleRadians);
-        if (FlipX)
-        {
-            angle = 360 - angle;
-        }
-
-        if (FlipY)
-        {
-            angle = 360 - angle;
-        }
-
-        RectD dirtyBounds = new RectD(0, 0, Document.Width, Document.Height);
-        Rect dirtyRect = new Rect(0, 0, Document.Width, Document.Height);
         
         float resolutionScale = CalculateResolutionScale();
 
+        RectD dirtyBounds = new RectD(0, 0, Document.Width / resolutionScale, Document.Height / resolutionScale);
+        Rect dirtyRect = new Rect(0, 0, Document.Width / resolutionScale, Document.Height / resolutionScale);
+        
+
         using var operation = new DrawSceneOperation(Surface, Document, CanvasPos, Scale * resolutionScale, angle, FlipX, FlipY,
             dirtyRect,
             Bounds,