1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

EdgeTable: Add offset before truncating to somewhat restore old rounding behaviour

This commit is contained in:
reuk 2023-06-06 14:06:18 +01:00
parent 399276b5b3
commit c8c4cdc7d5
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -55,8 +55,13 @@ EdgeTable::EdgeTable (Rectangle<int> area, const Path& path, const AffineTransfo
while (iter.next())
{
auto y1 = static_cast<int64_t> (iter.y1 * 256.0f);
auto y2 = static_cast<int64_t> (iter.y2 * 256.0f);
const auto scaleIterY = [] (auto y)
{
return static_cast<int64_t> (y * 256.0f + (y >= 0 ? 0.5f : -0.5f));
};
auto y1 = scaleIterY (iter.y1);
auto y2 = scaleIterY (iter.y2);
if (y1 != y2)
{