Skip to content

Commit

Permalink
Bug fix: Handling of alpha pixels when committing selection
Browse files Browse the repository at this point in the history
Updated FinishSelection in Document.cs to use DrawWithOperator to force the use of Operator.Source when committing the selection layer. Added overload of DrawWithOperator that supplies ImageSurface implicitly. (#840)
  • Loading branch information
logiclrd authored Jun 14, 2024
1 parent 84d5518 commit 2a1868d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Pinta.Core/Classes/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void FinishSelection ()

Context g = new (Layers.CurrentUserLayer.Surface);
selection.Clip (g);
layer.Draw (g);
layer.DrawWithOperator (g, Operator.Source, opacity: 1.0, transform: true);

Layers.DestroySelectionLayer ();
Workspace.Invalidate ();
Expand Down
5 changes: 5 additions & 0 deletions Pinta.Core/Classes/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ public void Draw (
ctx.Restore ();
}

public void DrawWithOperator (Context ctx, Operator op, double opacity = 1.0, bool transform = true)
{
DrawWithOperator (ctx, Surface, op, opacity, transform);
}

public void DrawWithOperator (
Context ctx,
ImageSurface surface,
Expand Down

0 comments on commit 2a1868d

Please sign in to comment.