(linux) Fixed a sigsegv when drawing a color brush which is completely outside screen (The only way is to use the circle tool)

SDL_UpdateRect was crashing because of receiving negative Width or Height.
This was due to Calculer_dimensions_clipees() clipping width or height so much that they become negative.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@222 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2008-10-10 00:33:22 +00:00
parent b0cd961188
commit 83ef6ef4ac

View File

@ -1856,6 +1856,8 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
Largeur=Brosse_Largeur; Largeur=Brosse_Largeur;
Hauteur=Brosse_Hauteur; Hauteur=Brosse_Hauteur;
Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur);
if (Largeur<=0 || Hauteur<=0)
break;
Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X); Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y);
Fin_Compteur_X=Debut_Compteur_X+Largeur; Fin_Compteur_X=Debut_Compteur_X+Largeur;