summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkbufferdisplay.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-03-20 23:04:32 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-03-20 23:04:32 (GMT)
commitff1ce15f6c4b3516d7a34b09dd99abb32a0bd671 (patch)
treee3925ba68b25ca5a73c7547704668cb8fad32ef9 /src/gtkext/gtkbufferdisplay.c
parent86a892e1bf5d3483929da3ea72bfcbfd43f6c6bc (diff)
Introduced zoom in graph view.
Diffstat (limited to 'src/gtkext/gtkbufferdisplay.c')
-rw-r--r--src/gtkext/gtkbufferdisplay.c18
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;
}