Fixed polygon and polyform overdrawing the first point in an approximate way.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1300 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2010-02-03 18:27:04 +00:00
parent 4c40a0a99a
commit 84ccd7f845
2 changed files with 16 additions and 3 deletions

1
main.c
View File

@ -835,7 +835,6 @@ void Program_shutdown(void)
// Remove the safety backups, this is normal exit // Remove the safety backups, this is normal exit
Delete_safety_backups(); Delete_safety_backups();
DEBUG("bye",1);
// On libère le buffer de gestion de lignes // On libère le buffer de gestion de lignes
free(Horizontal_line_buffer); free(Horizontal_line_buffer);

View File

@ -2025,8 +2025,14 @@ void Polygon_12_9(void)
Operation_pop(&end_y); Operation_pop(&end_y);
Operation_pop(&end_x); Operation_pop(&end_x);
Paintbrush_shape=Paintbrush_shape_before_operation; Paintbrush_shape=Paintbrush_shape_before_operation;
// Le pied aurait été de ne pas repasser sur le 1er point de la 1ère ligne
// mais c'est pas possible :( // Avoid overdrawing the first point
if(start_x < end_x) end_x--;
else if(start_x>end_x) end_x++;
if(start_y < end_y) end_y--;
else if(start_y>end_y) end_y++;
Draw_line_permanent(start_x,start_y,end_x,end_y,color); Draw_line_permanent(start_x,start_y,end_x,end_y,color);
Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; Paintbrush_shape=PAINTBRUSH_SHAPE_POINT;
@ -2347,6 +2353,14 @@ void Polyform_12_8(void)
// On efface la preview du segment annulé: // On efface la preview du segment annulé:
Hide_line_preview(start_x,start_y,end_x,end_y); Hide_line_preview(start_x,start_y,end_x,end_y);
// Avoid overdrawing the first point
if(start_x < initial_x) initial_x--;
else if(start_x>initial_x) initial_x++;
if(start_y < initial_y) initial_y--;
else if(start_y>initial_y) initial_y++;
// On affiche de façon définitive le bouclage du polygone: // On affiche de façon définitive le bouclage du polygone:
Draw_line_permanent(start_x,start_y,initial_x,initial_y,color); Draw_line_permanent(start_x,start_y,initial_x,initial_y,color);