summaryrefslogtreecommitdiff
path: root/src/glibext/gcodebuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r--src/glibext/gcodebuffer.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c
index 3f9af35..9f22df7 100644
--- a/src/glibext/gcodebuffer.c
+++ b/src/glibext/gcodebuffer.c
@@ -469,18 +469,19 @@ void g_buffer_view_draw(const GBufferView *view, const GdkEventExpose *event, Gd
lines = view->buffer->lines;
- for (i = first; i < last; i++)
- {
- /* TODO : skip if... */
+ if (view->buffer->used > 0)
+ for (i = first; i <= last; i++)
+ {
+ /* TODO : skip if... */
- if (view->drawing_extra != NULL)
- view->drawing_extra(lines[i], drawable, gc, fake_x, y, view->drawing_data);
+ if (view->drawing_extra != NULL)
+ view->drawing_extra(lines[i], drawable, gc, fake_x, y, view->drawing_data);
- g_buffer_line_draw(lines[i], drawable, gc, view->max_widths, real_x, y);
+ g_buffer_line_draw(lines[i], drawable, gc, view->max_widths, real_x, y);
- y += view->line_height;
+ y += view->line_height;
- }
+ }
}