Browse Source

Fixed rendering on bigger sizes

flabbet 1 year ago
parent
commit
5ee065f692
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/PixiEditor.ChangeableDocument/Rendering/DocumentEvaluator.cs

+ 5 - 3
src/PixiEditor.ChangeableDocument/Rendering/DocumentEvaluator.cs

@@ -30,12 +30,14 @@ public static class DocumentEvaluator
                 chunk.Surface.DrawingSurface.Canvas.ClipRect((RectD)transformedClippingRect);
             }
             
-            VecD pos = chunkPos * resolution.Multiplier();
+            VecD pos = chunkPos;
             int x = (int)(pos.X * ChunkyImage.FullChunkSize);
             int y = (int)(pos.Y * ChunkyImage.FullChunkSize);
+            int width = ChunkyImage.FullChunkSize;
+            int height = ChunkyImage.FullChunkSize;
             
-            RectD sourceRect = new(x, y, ChunkyImage.FullChunkSize, ChunkyImage.FullChunkSize);
-            RectD destRect = new(0, 0, ChunkyImage.FullChunkSize, ChunkyImage.FullChunkSize);
+            RectD sourceRect = new(x, y, width, height);
+            RectD destRect = new(0, 0, chunk.PixelSize.X, chunk.PixelSize.Y);
             
             chunk.Surface.DrawingSurface.Canvas.DrawImage(evaluated, sourceRect, destRect, context.ReplacingPaintWithOpacity);