AngusJohnson / Image32

An extensive 2D graphics library written in Delphi Pascal
Boost Software License 1.0
137 stars 31 forks source link

Fixes for the TMaskRenderer #98

Closed ahausladen closed 1 month ago

ahausladen commented 1 month ago

This PR fixes some bugs in the new TMaskRenderer.

There were some off-by-one bugs that could overwrite the first pixel in the next scanline. Also the ClipRect handling didn't match the CopyBlend function's interpretation. CopyBlend excludes Right/Bottom whereas TMaskRenderer included them. And because TMaskRenderer is a replacement for the Polygon()+CopyBlend(BlendMask) code that was in EraseOutsidePaths, it should give the exact same result.

The TMaskRenderer now also handles skipped scanlines for paths with disjunct polygons. For this the Rasterize() function has been extended to notify the renderer about the skipped scanlines.

ahausladen commented 1 month ago

This fixes #94