* src/raster/ftraster.c (Line_Up): Use 64-bit calculations.

Attempt to fix #1332.
This commit is contained in:
Alexei Podtelezhnikov 2025-05-09 16:31:16 -04:00
parent 6fa8725a41
commit 9629cc0e83

View file

@ -251,7 +251,11 @@
/* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */
/* for clipping computations. It simply uses the FT_MulDiv() function */
/* defined in `ftcalc.h'. */
#define SMulDiv_No_Round FT_MulDiv_No_Round
#ifdef FT_INT64
#define SMulDiv( a, b, c ) (Long)( (FT_Int64)(a) * (b) / (c) )
#else
#define SMulDiv FT_MulDiv_No_Round
#endif
/* The rasterizer is a very general purpose component; please leave */
/* the following redefinitions there (you never know your target */
@ -967,14 +971,14 @@
goto Fin;
}
Ix = SMulDiv_No_Round( e - y1, Dx, Dy );
Ix = SMulDiv( e - y1, Dx, Dy );
x1 += Ix;
*top++ = x1;
if ( --size )
{
Ax = Dx * ( e - y1 ) - Dy * Ix; /* remainder */
Ix = FMulDiv( ras.precision, Dx, Dy );
Ix = SMulDiv( ras.precision, Dx, Dy );
Rx = Dx * ras.precision - Dy * Ix; /* remainder */
Dx = 1;