diff options
-rw-r--r-- | trace-graph.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/trace-graph.c b/trace-graph.c index 1f7668d..fe2ecb4 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -747,6 +747,7 @@ static int check_sched_switch(struct graph_info *ginfo, | |||
747 | static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y) | 747 | static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y) |
748 | { | 748 | { |
749 | PangoLayout *layout; | 749 | PangoLayout *layout; |
750 | GtkAdjustment *vadj; | ||
750 | struct record *record = NULL; | 751 | struct record *record = NULL; |
751 | struct pevent *pevent; | 752 | struct pevent *pevent; |
752 | struct event_format *event; | 753 | struct event_format *event; |
@@ -841,14 +842,15 @@ static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y) | |||
841 | width += CPU_BOARDER * 2; | 842 | width += CPU_BOARDER * 2; |
842 | height += CPU_BOARDER * 2; | 843 | height += CPU_BOARDER * 2; |
843 | 844 | ||
844 | if (y > height) | ||
845 | y -= height; | ||
846 | |||
847 | view_start = gtk_adjustment_get_value(ginfo->hadj); | 845 | view_start = gtk_adjustment_get_value(ginfo->hadj); |
848 | view_width = gtk_adjustment_get_page_size(ginfo->hadj); | 846 | view_width = gtk_adjustment_get_page_size(ginfo->hadj); |
849 | 847 | if (x > view_start + width) | |
850 | if (x + width > view_start + view_width) | 848 | x -= width; |
851 | x -= (x + width) - (view_start + view_width); | 849 | |
850 | vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(ginfo->scrollwin)); | ||
851 | view_start = gtk_adjustment_get_value(vadj); | ||
852 | if (y > view_start + height) | ||
853 | y -= height; | ||
852 | 854 | ||
853 | ginfo->cpu_data_x = x; | 855 | ginfo->cpu_data_x = x; |
854 | ginfo->cpu_data_y = y; | 856 | ginfo->cpu_data_y = y; |