sw_engine: fix radial coefficients calculations

In the Taylor series expansion, there was a missing
division by 2! in the term with the second derivative.

@Issue: https://github.com/thorvg/thorvg/issues/2530
This commit is contained in:
Mira Grudzinska 2024-07-27 01:07:25 +02:00 committed by Hermet Park
parent 4ed9ada00e
commit 7274b3d601

View file

@ -58,7 +58,7 @@ static void _calculateCoefficients(const SwFill* fill, uint32_t x, uint32_t y, f
auto deltaDeltaRr = 2.0f * (radial->a11 * radial->a11 + radial->a21 * radial->a21) * radial->invA;
det = b * b + (rr - radial->fr * radial->fr) * radial->invA;
deltaDet = 2.0f * b * deltaB + deltaB * deltaB + deltaRr + deltaDeltaRr;
deltaDet = 2.0f * b * deltaB + deltaB * deltaB + deltaRr + deltaDeltaRr * 0.5f;
deltaDeltaDet = 2.0f * deltaB * deltaB + deltaDeltaRr;
}