Fix crash when rotating a tiny brush (bug from original version, was harmless in DOS due to lack of memory protection)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@726 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-04-06 18:06:06 +00:00
parent 61e2487ec6
commit 15e11b7144

View File

@ -1549,7 +1549,7 @@ void Compute_quad_texture(int x1,int y1,int xt1,int yt1,
temp=(float)(0.5+(float)x-ScanY_X[0][y])/(float)line_width;
xt=Round((float)(ScanY_Xt[0][y])+(temp*(ScanY_Xt[1][y]-ScanY_Xt[0][y])));
yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y])));
if (xt>=0 && yt>=0)
buffer[x+(y*width)]=Read_pixel_from_brush(xt,yt);
}
for (; x<width; x++)
@ -1709,12 +1709,14 @@ void Draw_quad_texture_preview(int x1,int y1,int xt1,int yt1,
temp=(float)(0.5+(float)x-ScanY_X[0][y])/(float)width;
xt=Round((float)(ScanY_Xt[0][y])+(temp*(ScanY_Xt[1][y]-ScanY_Xt[0][y])));
yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y])));
if (xt>=0 && yt>=0)
{
color=Read_pixel_from_brush(xt,yt);
if (color!=Back_color)
Pixel_preview(x,y_,color);
}
}
}
free(ScanY_Xt[0]);
free(ScanY_Xt[1]);