diff options
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/gbufferline.c | 4 | ||||
-rw-r--r-- | src/glibext/gbufferline.h | 4 | ||||
-rw-r--r-- | src/glibext/gcodebuffer.c | 11 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c index 4360f8c..ce3e19f 100644 --- a/src/glibext/gbufferline.c +++ b/src/glibext/gbufferline.c @@ -35,10 +35,6 @@ -/* Espace entre les colonnes */ -#define COL_MARGIN 23 - - /* ---------------------------- REGROUPEMENT PAR COLONNE ---------------------------- */ diff --git a/src/glibext/gbufferline.h b/src/glibext/gbufferline.h index ce75895..3cc992b 100644 --- a/src/glibext/gbufferline.h +++ b/src/glibext/gbufferline.h @@ -100,9 +100,13 @@ typedef enum _RenderingTagType #define RTT_NONE RTT_RAW /* TODO : remme */ + /* Confort pour l'insertion de texte */ #define SL(str) str, strlen(str) +/* Espace entre les colonnes */ +#define COL_MARGIN 23 + /* Accompagnement du dessin pour compléments */ typedef void (* buffer_line_draw_fc) (GBufferLine *, GdkDrawable *, GdkGC *, gint, gint, void *); diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c index 573d07d..aec3303 100644 --- a/src/glibext/gcodebuffer.c +++ b/src/glibext/gcodebuffer.c @@ -803,12 +803,12 @@ void g_buffer_view_get_size(GBufferView *view, gint *width, gint *height, bool a size_t first; /* Première ligne intégrée */ size_t last; /* Dernière ligne intégrée */ - *width = 0; - *height = view->line_height; - if (!WIDTHS_CACHED(view)) g_buffer_view_compute_required_widths(view); + *width = view->left_text; + *height = view->line_height; + for (i = 0; i < BLC_COUNT; i++) { if (i == BLC_ADDRESS && !addr) continue; @@ -816,6 +816,9 @@ void g_buffer_view_get_size(GBufferView *view, gint *width, gint *height, bool a *width += view->max_widths[i]; + if ((i + 1) < BLC_COUNT) + *width += COL_MARGIN; + } first = g_code_buffer_get_index_from_address(view->buffer, view->start); @@ -1083,7 +1086,7 @@ bool g_buffer_view_get_address_coordinates(GBufferView *view, vmpa_t addr, gint first = g_code_buffer_get_index_from_address(view->buffer, view->start); last = g_code_buffer_get_index_from_address(view->buffer, view->end); - for (i = first; i < last; i++) + for (i = first; i <= last; i++) { current = g_buffer_line_get_address(view->buffer->lines[i]); |