Browse Source

Implemented clip to layer below

flabbet 10 months ago
parent
commit
bbc16fcf2d

+ 2 - 5
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/LayerNode.cs

@@ -80,7 +80,7 @@ public abstract class LayerNode : StructureNode, IReadOnlyLayerNode
 
 
             if (Background.Value != null)
             if (Background.Value != null)
             {
             {
-                using Texture tempSurface = RequestTexture(4, size);
+                Texture tempSurface = RequestTexture(4, size);
                 if (Background.Connection.Node is LayerNode layerNode)
                 if (Background.Connection.Node is LayerNode layerNode)
                 {
                 {
                     // TODO: This probably should work with StructureMembers not Layers only
                     // TODO: This probably should work with StructureMembers not Layers only
@@ -89,15 +89,12 @@ public abstract class LayerNode : StructureNode, IReadOnlyLayerNode
 
 
                 ApplyRasterClip(outputWorkingSurface.DrawingSurface, tempSurface.DrawingSurface);
                 ApplyRasterClip(outputWorkingSurface.DrawingSurface, tempSurface.DrawingSurface);
                 blendPaint.BlendMode = RenderContext.GetDrawingBlendMode(BlendMode.Value);
                 blendPaint.BlendMode = RenderContext.GetDrawingBlendMode(BlendMode.Value);
-                tempSurface.DrawingSurface.Canvas.DrawSurface(outputWorkingSurface.DrawingSurface, 0, 0,
-                    blendPaint);
+                tempSurface.DrawingSurface.Canvas.DrawSurface(outputWorkingSurface.DrawingSurface, 0, 0, blendPaint);
 
 
-                //cached.DrawingSurface.Canvas.DrawSurface(tempSurface.DrawingSurface, VecI.Zero, blendPaint);\
                 renderOnto.Canvas.DrawSurface(tempSurface.DrawingSurface, 0, 0, blendPaint);
                 renderOnto.Canvas.DrawSurface(tempSurface.DrawingSurface, 0, 0, blendPaint);
                 return;
                 return;
             }
             }
 
 
-            //cached.DrawingSurface.Canvas.DrawSurface(outputWorkingSurface.DrawingSurface, 0, 0, blendPaint);
             renderOnto.Canvas.DrawSurface(outputWorkingSurface.DrawingSurface, 0, 0, blendPaint);
             renderOnto.Canvas.DrawSurface(outputWorkingSurface.DrawingSurface, 0, 0, blendPaint);
         }
         }
     }
     }

+ 1 - 1
src/PixiEditor/Views/Rendering/Scene.cs

@@ -532,7 +532,7 @@ internal class DrawSceneOperation : SkiaDrawOperation
 
 
         int count = canvas.Save();
         int count = canvas.Save();
 
 
-        //using var ctx = DrawingBackendApi.Current.RenderOnDifferentGrContext(lease.GrContext);
+        using var ctx = DrawingBackendApi.Current.RenderOnDifferentGrContext(lease.GrContext);
 
 
         using SKPaint paint = new SKPaint();
         using SKPaint paint = new SKPaint();
         paint.Color = paint.Color.WithAlpha((byte)(opacity * 255));
         paint.Color = paint.Color.WithAlpha((byte)(opacity * 255));