Some more fixes for the gradiation rectangles. The position is now calculated in an int, you should not experience any problem with the circle limit.
Also fixed the operation handling. The rectangle is now drawn properly when you finish sizing it. The vector line still leaves some artifact on screen, however... git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@310 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
6
graph.c
6
graph.c
@@ -5213,7 +5213,7 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,
|
||||
|
||||
short a = (VBY - VAY)/(VBX - VAX);
|
||||
short b = VAY - a*VAX;
|
||||
short Distance_X, Distance_Y;
|
||||
int Distance_X, Distance_Y;
|
||||
|
||||
DEBUG("inttotal",Degrade_Intervalle_total);
|
||||
|
||||
@@ -5221,8 +5221,8 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,
|
||||
for (Pos_X = RAX;Pos_X<RBX;Pos_X++)
|
||||
{
|
||||
// On calcule ou on en est dans le dégradé
|
||||
Distance_X = pow(Pos_Y - VAY,2)+pow(Pos_X - VAX,2);
|
||||
Distance_Y = pow(-a * Pos_X + Pos_Y - b,2)/(a*a+1);
|
||||
Distance_X = pow((int)(Pos_Y - VAY),2)+pow((int)(Pos_X - VAX),2);
|
||||
Distance_Y = pow((int)(-a * Pos_X + Pos_Y - b),2)/(a*a+1);
|
||||
|
||||
printf("%d\t%d\t%d\n",Pos_X,Distance_X,Distance_Y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user