Some tweaks and fixups to the gradiation rectangles. Clipping and zoom mode work better, but :

-I introduced some weird bug making lines appear on the screen when drawing outside the limits of the zoom in zoom mode. Seems there is a XOR line function that get called with negative coordinates
-The preview rectangle is drawn with XOR-lines on the screen and does not modify the picture. So it is possible to erase it in the zoom screen by moving the cursor around it.
-Maybe I missed some testcases, i did not manage to reproduce the problem trigerred by grid clipping, for one.
-The gradiation vector is horizontal when it should be inclined. I probably missed something when writing the code for it. Probably a division gets out of precision... i should check if i used floats where needed


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@339 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2008-11-13 21:56:03 +00:00
parent 14536f17d1
commit d016b8ba48
3 changed files with 62 additions and 5 deletions

10
graph.c
View File

@@ -5246,6 +5246,16 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,
RAY = Pos_Y;
}
// Correction des bornes d'après les limites
if (RAY<Limite_Haut)
RAY=Limite_Haut;
if (RBY>Limite_Bas)
RBY=Limite_Bas;
if (RAX<Limite_Gauche)
RAX=Limite_Gauche;
if (RBX>Limite_Droite)
RBX=Limite_Droite;
if(VBX == VAX)
{
// Le vecteur est vertical, donc on évite la partie en dessous qui foirerait avec une division par 0...