aboutsummaryrefslogtreecommitdiffstats
path: root/trace-graph.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2009-12-23 19:30:43 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-23 19:30:43 -0500
commit91e8a12577889478264c5bf47773f5ec62b6e98f (patch)
tree4f9bcf1c56bbfd1708730586995b92d8c46b50f8 /trace-graph.c
parentbd33669eec11ba0b7e6dc1ac1dc861b14cabdd17 (diff)
kernelshark: Fixed resize and full_width
When resizing full_width was not being adjusted and this caused problems with selections in the tree view for the graph. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-graph.c')
-rw-r--r--trace-graph.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/trace-graph.c b/trace-graph.c
index d880f39..da3162c 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -579,6 +579,8 @@ static void zoom_in_window(struct graph_info *ginfo, gint start, gint end)
579 printf("no adjustment\n"); 579 printf("no adjustment\n");
580 580
581 ginfo->draw_width = new_width; 581 ginfo->draw_width = new_width;
582 printf("zoom in draw_width=%d full_width=%d\n",
583 ginfo->draw_width, ginfo->full_width);
582 584
583 if (ginfo->draw_width > MAX_WIDTH) { 585 if (ginfo->draw_width > MAX_WIDTH) {
584 gint new_start; 586 gint new_start;
@@ -1085,6 +1087,8 @@ static void draw_info(struct graph_info *ginfo,
1085 ginfo->resolution = (gdouble)new_width / (gdouble)(ginfo->view_end_time - 1087 ginfo->resolution = (gdouble)new_width / (gdouble)(ginfo->view_end_time -
1086 ginfo->view_start_time); 1088 ginfo->view_start_time);
1087 1089
1090 ginfo->full_width = (ginfo->end_time - ginfo->start_time) * ginfo->resolution;
1091
1088 draw_timeline(ginfo, new_width); 1092 draw_timeline(ginfo, new_width);
1089 1093
1090 1094
@@ -1106,7 +1110,7 @@ void trace_graph_select_by_time(struct graph_info *ginfo, guint64 time)
1106 guint64 old_start_time = ginfo->view_start_time; 1110 guint64 old_start_time = ginfo->view_start_time;
1107 1111
1108 view_width = gtk_adjustment_get_page_size(ginfo->vadj); 1112 view_width = gtk_adjustment_get_page_size(ginfo->vadj);
1109 width = ginfo->draw_width ? : view_width; 1113 width = ginfo->draw_width ? : ginfo->full_width;
1110 1114
1111 mid = (time - ginfo->start_time) * ginfo->resolution; 1115 mid = (time - ginfo->start_time) * ginfo->resolution;
1112 start = mid - width / 2; 1116 start = mid - width / 2;
@@ -1120,8 +1124,8 @@ void trace_graph_select_by_time(struct graph_info *ginfo, guint64 time)
1120 1124
1121 if (end > ginfo->full_width) { 1125 if (end > ginfo->full_width) {
1122 start -= end - ginfo->full_width; 1126 start -= end - ginfo->full_width;
1123 end = ginfo->full_width;
1124 g_assert(start >= 0); 1127 g_assert(start >= 0);
1128 end = ginfo->full_width;
1125 } 1129 }
1126 1130
1127 ginfo->start_x = start; 1131 ginfo->start_x = start;