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

EdgeTable: Fix assertion caused by unnecessarily storing prepending zero levels

This partially restores the behaviour prior to commit
dda0719d56, in that we will never store a
segment if its level equals the last stored level.
This commit is contained in:
attila 2024-08-29 17:19:58 +02:00
parent adeac2a2ea
commit 83720ac462

View file

@ -549,7 +549,7 @@ void EdgeTable::intersectWithEdgeTableLine (const int y, const int* const otherL
int destIndex = 0, destTotal = 0;
int level1 = 0, level2 = 0;
int lastX = std::numeric_limits<int>::min(), lastLevel = 0;
int lastLevel = 0;
while (! srcLine1.empty() && ! srcLine2.empty())
{
@ -579,7 +579,7 @@ void EdgeTable::intersectWithEdgeTableLine (const int y, const int* const otherL
const auto nextLevel = (level1 * (level2 + 1)) / scale;
if (std::exchange (lastX, nextX) < nextX || std::exchange (lastLevel, nextLevel) != nextLevel)
if (std::exchange (lastLevel, nextLevel) != nextLevel)
{
jassert (isPositiveAndBelow (nextLevel, 256));
@ -606,7 +606,6 @@ void EdgeTable::intersectWithEdgeTableLine (const int y, const int* const otherL
}
++destTotal;
lastLevel = nextLevel;
if (! isUsingTempSpace)
{