diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-03-20 23:04:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-03-20 23:04:32 (GMT) |
commit | ff1ce15f6c4b3516d7a34b09dd99abb32a0bd671 (patch) | |
tree | e3925ba68b25ca5a73c7547704668cb8fad32ef9 /src/gtkext/gtkbufferdisplay.c | |
parent | 86a892e1bf5d3483929da3ea72bfcbfd43f6c6bc (diff) |
Introduced zoom in graph view.
Diffstat (limited to 'src/gtkext/gtkbufferdisplay.c')
-rw-r--r-- | src/gtkext/gtkbufferdisplay.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gtkext/gtkbufferdisplay.c b/src/gtkext/gtkbufferdisplay.c index b9784de..b7af1d6 100644 --- a/src/gtkext/gtkbufferdisplay.c +++ b/src/gtkext/gtkbufferdisplay.c @@ -423,8 +423,14 @@ static gboolean gtk_buffer_display_draw(GtkWidget *widget, cairo_t *cr) if (parent->show_border) { - gtk_display_panel_define_border_path(parent, cr, 0, 0); + gtk_widget_get_allocation(widget, &allocation); + + allocation.x = 0; + allocation.y = 0; + + gtk_display_panel_define_border_path(parent, cr, &allocation); cairo_clip(cr); + } /* Décalage pour le défilement horizontal */ @@ -441,7 +447,7 @@ static gboolean gtk_buffer_display_draw(GtkWidget *widget, cairo_t *cr) cache = g_buffer_view_get_cache(display->view); - left_margin = g_buffer_cache_get_left_margin(cache); + left_margin = g_buffer_cache_get_left_margin(cache) * parent->scale; g_object_unref(G_OBJECT(cache)); @@ -494,6 +500,10 @@ static gboolean gtk_buffer_display_draw(GtkWidget *widget, cairo_t *cr) /* Impression du désassemblage */ + cairo_save(cr); + + cairo_scale(cr, parent->scale, parent->scale); + if (display->view != NULL) { g_generic_config_get_value(get_main_configuration(), MPK_SELECTION_LINE, &sel_line); @@ -511,7 +521,7 @@ static gboolean gtk_buffer_display_draw(GtkWidget *widget, cairo_t *cr) virt_y += area.y; g_buffer_view_draw(display->view, cr, virt_y, &area, parent->options, &display->offsets, - selected, parent->export); + selected, parent->scale, parent->export); } @@ -528,6 +538,8 @@ static gboolean gtk_buffer_display_draw(GtkWidget *widget, cairo_t *cr) GTK_WIDGET_CLASS(gtk_buffer_display_parent_class)->draw(widget, cr); + cairo_restore(cr); + return FALSE; } |