Skip to content

Commit

Permalink
Fix coordinate assignment in pixel buffer
Browse files Browse the repository at this point in the history
This commit rectifies a redundant coordinate calculation in the DrawingContextImpl. It eliminates the need for duplicate addition of 'j' to 'characterPoint.X' by directly using 'newCharacterPoint' instead. This simplification not only reduces redundancy but also enhances code readability.
  • Loading branch information
jinek committed Jan 5, 2024
1 parent 270a018 commit 339b15d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Consolonia.Core/Drawing/DrawingContextImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void DrawPixelAndMoveHead(int count)
Point newCharacterPoint = characterPoint.WithX(characterPoint.X + j);
CurrentClip.ExecuteWithClipping(newCharacterPoint, () =>
{
_pixelBuffer.Set((PixelBufferCoordinate)characterPoint.WithX(characterPoint.X + j),
_pixelBuffer.Set((PixelBufferCoordinate)newCharacterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);
});
}
Expand Down

0 comments on commit 339b15d

Please sign in to comment.