Fix the Contour not advancing the backup/redo status.
Fix the polygon filling (used in 3 tools) to include all the right pixels. whoo! Fix the operations' cursors, that I broke when I added Contour. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@582 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
4349fd71a3
commit
db02be0e41
1
global.h
1
global.h
@ -597,6 +597,7 @@ GFX2_GLOBAL short Pipette_Y;
|
|||||||
FORME_CURSEUR_CIBLE , // Dessin à la main continu
|
FORME_CURSEUR_CIBLE , // Dessin à la main continu
|
||||||
FORME_CURSEUR_CIBLE , // Dessin à la main discontinu
|
FORME_CURSEUR_CIBLE , // Dessin à la main discontinu
|
||||||
FORME_CURSEUR_CIBLE , // Dessin à la main point par point
|
FORME_CURSEUR_CIBLE , // Dessin à la main point par point
|
||||||
|
FORME_CURSEUR_CIBLE , // Contour fill
|
||||||
FORME_CURSEUR_CIBLE , // Lignes
|
FORME_CURSEUR_CIBLE , // Lignes
|
||||||
FORME_CURSEUR_CIBLE , // Lignes reliées
|
FORME_CURSEUR_CIBLE , // Lignes reliées
|
||||||
FORME_CURSEUR_CIBLE , // Lignes centrées
|
FORME_CURSEUR_CIBLE , // Lignes centrées
|
||||||
|
|||||||
22
graph.c
22
graph.c
@ -2049,7 +2049,6 @@ void Polyfill_General(int Vertices, short * Points, int Color)
|
|||||||
POLYGON_EDGE *active_edges = NULL;
|
POLYGON_EDGE *active_edges = NULL;
|
||||||
POLYGON_EDGE *inactive_edges = NULL;
|
POLYGON_EDGE *inactive_edges = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* allocate some space and fill the edge table */
|
/* allocate some space and fill the edge table */
|
||||||
initial_edge=edge=(POLYGON_EDGE *) malloc(sizeof(POLYGON_EDGE) * Vertices);
|
initial_edge=edge=(POLYGON_EDGE *) malloc(sizeof(POLYGON_EDGE) * Vertices);
|
||||||
|
|
||||||
@ -2138,6 +2137,7 @@ void Polyfill_General(int Vertices, short * Points, int Color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(initial_edge);
|
free(initial_edge);
|
||||||
|
|
||||||
// On ne connait pas simplement les xmin et xmax ici, mais de toutes façon ce n'est pas utilisé en preview
|
// On ne connait pas simplement les xmin et xmax ici, mais de toutes façon ce n'est pas utilisé en preview
|
||||||
Mettre_Ecran_A_Jour(0,top,Principal_Largeur_image,bottom-top+1);
|
Mettre_Ecran_A_Jour(0,top,Principal_Largeur_image,bottom-top+1);
|
||||||
}
|
}
|
||||||
@ -2145,8 +2145,28 @@ void Polyfill_General(int Vertices, short * Points, int Color)
|
|||||||
|
|
||||||
void Polyfill(int Vertices, short * Points, int Color)
|
void Polyfill(int Vertices, short * Points, int Color)
|
||||||
{
|
{
|
||||||
|
int Indice;
|
||||||
|
byte *FX_Feedback_Ecran_avant_remplissage;
|
||||||
|
|
||||||
|
// Comme pour le Fill, cette operation fait un peu d'"overdraw"
|
||||||
|
// (pixels dessinés plus d'une fois) alors on force le FX Feedback à OFF
|
||||||
|
FX_Feedback_Ecran_avant_remplissage=FX_Feedback_Ecran;
|
||||||
|
FX_Feedback_Ecran=Ecran_backup;
|
||||||
|
|
||||||
Pixel_figure=Afficher_pixel;
|
Pixel_figure=Afficher_pixel;
|
||||||
Polyfill_General(Vertices,Points,Color);
|
Polyfill_General(Vertices,Points,Color);
|
||||||
|
|
||||||
|
// Remarque: pour dessiner la bordure avec la brosse en cours au lieu
|
||||||
|
// d'un pixel de couleur premier-plan, il suffit de mettre ici:
|
||||||
|
// Pixel_figure=Pixel_figure_Definitif;
|
||||||
|
|
||||||
|
// Dessin du contour
|
||||||
|
for (Indice=0; Indice<Vertices-1;Indice+=1)
|
||||||
|
Tracer_ligne_General(Points[Indice*2],Points[Indice*2+1],Points[Indice*2+2],Points[Indice*2+3],Color);
|
||||||
|
Tracer_ligne_General(Points[0],Points[1],Points[Indice*2],Points[Indice*2+1],Color);
|
||||||
|
|
||||||
|
// restore de l'etat du FX Feedback
|
||||||
|
FX_Feedback_Ecran=FX_Feedback_Ecran_avant_remplissage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2560,7 +2560,7 @@ void Filled_polyform_12_0(void)
|
|||||||
|
|
||||||
// Cette opération étant également utilisée pour le lasso, on ne fait pas de
|
// Cette opération étant également utilisée pour le lasso, on ne fait pas de
|
||||||
// backup si on prend une brosse au lasso avec le bouton gauche.
|
// backup si on prend une brosse au lasso avec le bouton gauche.
|
||||||
if ((Operation_en_cours==OPERATION_FILLED_POLYFORM) || (Mouse_K==A_DROITE))
|
if ((Operation_en_cours==OPERATION_FILLED_POLYFORM) || (Operation_en_cours==OPERATION_FILLED_CONTOUR) || (Mouse_K==A_DROITE))
|
||||||
Backup();
|
Backup();
|
||||||
|
|
||||||
Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite;
|
Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user