فهرست منبع

readonly render state

Krzysztof Krysiński 1 روز پیش
والد
کامیت
dc4ed7569a

+ 0 - 11
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/Effects/PosterizationNode.cs

@@ -141,17 +141,6 @@ public class PosterizationNode : RenderNode, IRenderInput
         surface.Canvas.DrawSurface(temp.DrawingSurface, 0, 0);
         surface.Canvas.RestoreToCount(saved);
     }
-    
-    public override RectD? GetPreviewBounds(int frame, string elementToRenderName = "")
-    {
-        return new RectD(0, 0, lastDocumentSize.X, lastDocumentSize.Y);
-    }
-
-    public override bool RenderPreview(DrawingSurface renderOn, RenderContext context, string elementToRenderName)
-    {
-        OnPaint(context, renderOn);
-        return true;
-    }
 
     public override Node CreateCopy()
     {

+ 10 - 10
src/PixiEditor/Models/Rendering/SceneRenderer.cs

@@ -362,17 +362,17 @@ internal class SceneRenderer
     }
 }
 
-struct RenderState
+readonly struct RenderState
 {
-    public ChunkResolution ChunkResolution { get; set; }
-    public bool HighResRendering { get; set; }
-    public string TargetOutput { get; set; }
-    public int GraphCacheHash { get; set; }
-    public RectD VisibleDocumentRegion { get; set; }
-    public double ZoomLevel { get; set; }
-    public int OnionFrames { get; set; }
-    public double OnionOpacity { get; set; }
-    public bool OnionSkinning { get; set; }
+    public ChunkResolution ChunkResolution { get; init; }
+    public bool HighResRendering { get; init; }
+    public string TargetOutput { get; init; }
+    public int GraphCacheHash { get; init; }
+    public RectD VisibleDocumentRegion { get; init; }
+    public double ZoomLevel { get; init; }
+    public int OnionFrames { get; init; }
+    public double OnionOpacity { get; init; }
+    public bool OnionSkinning { get; init; }
 
     public bool ShouldRerender(RenderState other)
     {