summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-11-02 15:50:07 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-11-02 15:50:07 (GMT)
commitf5df6496fa50927d3d274c939a888afde652b7ad (patch)
tree281dbfdfdcb8765fea7036af274c63fb5acde8ff /src/glibext
parentc3aba0893c29cc098c029306fd7a4c8c1fa2eee2 (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')
-rw-r--r--src/glibext/gbufferline.c4
-rw-r--r--src/glibext/gbufferline.h4
-rw-r--r--src/glibext/gcodebuffer.c11
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]);