Changed ImagDrawLine to be more acurate

This commit is contained in:
Kaggen67 2026-05-20 16:57:17 +02:00
parent 28efddf6d4
commit 8c53e2a097

View File

@ -3524,6 +3524,7 @@ void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int en
if (yLonger)
{
// If line is more vertical, iterate over y-axis
// Init j with 0.5 in 16-bit fixed point (1 << 15) for better rounding.
for (int i = 0, j = (1 << 15); i != endVal; i += sgnInc, j += decInc)
{
// Calculate pixel position and draw it