diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-11-02 15:50:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-11-02 15:50:07 (GMT) |
commit | f5df6496fa50927d3d274c939a888afde652b7ad (patch) | |
tree | 281dbfdfdcb8765fea7036af274c63fb5acde8ff /src/glibext/gcodebuffer.c | |
parent | c3aba0893c29cc098c029306fd7a4c8c1fa2eee2 (diff) |
Improved the computing and the rendering of the graphic view.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@277 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r-- | src/glibext/gcodebuffer.c | 11 |
1 files changed, 7 insertions, 4 deletions
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]); |