CWBudde / AggPasMod

Modernized Pascal Anti-Grain Geometry
Other
75 stars 25 forks source link

Integer overflow in unit AggSpanGradient function TAggGradientRadialFocus.Calculate #14

Open BVerhue opened 4 years ago

BVerhue commented 4 years ago

I got a integer overflow on line 446

CurToFocus := Sqr(X - FFocus.X) + Sqr(Y - FFocus.Y);

Solved it by changing it to

CurToFocus := Sqr(1.0 X - FFocus.X) + Sqr(1.0 Y - FFocus.Y);

CWBudde commented 4 years ago

I'm not really happy with the workaround as I don't know about the implications on the CPU level. I have to check this by myself. Can you recommend any example that runs directly into this issue?