From f08d214e1b13bd56e0305e2e4ae511f6f7514195 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 16 Oct 2012 23:55:39 +0000 Subject: Skipped documentation when computing line widths for rendering. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@270 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 7 +++++++ src/decomp/output.c | 3 +++ src/glibext/gbufferline.c | 28 +++++++++++++++++++++++++++- src/glibext/gbufferline.h | 3 +++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b7572f3..cab358c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 12-10-17 Cyrille Bagard + * src/decomp/output.c: + * src/glibext/gbufferline.c: + * src/glibext/gbufferline.h: + Skip documentation when computing line widths for rendering. + +12-10-17 Cyrille Bagard + * plugins/pychrysa/plugin.c: The one which reallocs has to become the one which frees ! diff --git a/src/decomp/output.c b/src/decomp/output.c index 20e18a9..fd10921 100644 --- a/src/decomp/output.c +++ b/src/decomp/output.c @@ -270,7 +270,10 @@ GBufferLine *g_lang_output_start_routine_info(const GLangOutput *output, GCodeBu GBufferLine *result; /* Adresse nouvelle à remonter */ if (output->start_routine_proto != NULL) + { result = output->start_info(output, buffer); + g_buffer_line_skip_width(result); + } else result = NULL; diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c index 6e3c928..4360f8c 100644 --- a/src/glibext/gbufferline.c +++ b/src/glibext/gbufferline.c @@ -89,6 +89,8 @@ struct _GBufferLine BufferLineColumn merge_start; /* Début de la zone globale */ BufferLineColumn last_used; /* Dernière colonne utilisée */ + bool skip_width; /* Pas de taille comptabilisée */ + }; /* Représentation de fragments de texte en ligne (classe) */ @@ -673,6 +675,25 @@ char *g_buffer_line_get_text(const GBufferLine *line) /****************************************************************************** * * +* Paramètres : line = ligne à venir compléter. * +* * +* Description : Marque la ligne comme étant sans largeur à comptabiliser. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_buffer_line_skip_width(GBufferLine *line) +{ + line->skip_width = true; + +} + + +/****************************************************************************** +* * * Paramètres : line = ligne à venir compléter. * * index = index de la colonne visée par la procédure. * * * @@ -686,7 +707,12 @@ char *g_buffer_line_get_text(const GBufferLine *line) gint g_buffer_line_get_width(GBufferLine *line, BufferLineColumn index) { - return get_column_width(&line->columns[index]); + gint result; /* Largeur à retourner */ + + if (line->skip_width) result = 0; + else result = get_column_width(&line->columns[index]); + + return result; } diff --git a/src/glibext/gbufferline.h b/src/glibext/gbufferline.h index 3f0676a..ce75895 100644 --- a/src/glibext/gbufferline.h +++ b/src/glibext/gbufferline.h @@ -132,6 +132,9 @@ void g_buffer_line_insert_text(GBufferLine *, BufferLineColumn, const char *, si /* Donne le texte représenté par une ligne de tampon. */ char *g_buffer_line_get_text(const GBufferLine *); +/* Marque la ligne comme étant sans largeur à comptabiliser. */ +void g_buffer_line_skip_width(GBufferLine *); + /* Fournit la largeur requise pour une colonne de ligne donnée. */ gint g_buffer_line_get_width(GBufferLine *, BufferLineColumn); -- cgit v0.11.2-87-g4458