|
|
@@ -181,31 +181,35 @@ copy_region(int start_x, int end_x, int dest_x) {
|
|
|
// indicated level data.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GtkStatsStripChart::
|
|
|
-draw_slice(int x, int frame_number) {
|
|
|
+draw_slice(int x, int w, int frame_number) {
|
|
|
const FrameData &frame = get_frame_data(frame_number);
|
|
|
|
|
|
- // Start by clearing the band first.
|
|
|
- _pixmap.draw_line(_white_gc, x, 0, x, get_ysize());
|
|
|
+ while (w > 0) {
|
|
|
+ // Start by clearing the band first.
|
|
|
+ _pixmap.draw_line(_white_gc, x, 0, x, get_ysize());
|
|
|
|
|
|
- float overall_time = 0.0;
|
|
|
- int y = get_ysize();
|
|
|
+ float overall_time = 0.0;
|
|
|
+ int y = get_ysize();
|
|
|
|
|
|
- FrameData::const_iterator fi;
|
|
|
- for (fi = frame.begin(); fi != frame.end(); ++fi) {
|
|
|
- const ColorData &cd = (*fi);
|
|
|
- overall_time += cd._net_value;
|
|
|
+ FrameData::const_iterator fi;
|
|
|
+ for (fi = frame.begin(); fi != frame.end(); ++fi) {
|
|
|
+ const ColorData &cd = (*fi);
|
|
|
+ overall_time += cd._net_value;
|
|
|
|
|
|
- if (overall_time > get_vertical_scale()) {
|
|
|
- // Off the top. Go ahead and clamp it by hand, in case it's so
|
|
|
- // far off the top we'd overflow the 16-bit pixel value.
|
|
|
- _pixmap.draw_line(get_collector_gc(cd._collector_index), x, y, x, 0);
|
|
|
- // And we can consider ourselves done now.
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (overall_time > get_vertical_scale()) {
|
|
|
+ // Off the top. Go ahead and clamp it by hand, in case it's so
|
|
|
+ // far off the top we'd overflow the 16-bit pixel value.
|
|
|
+ _pixmap.draw_line(get_collector_gc(cd._collector_index), x, y, x, 0);
|
|
|
+ // And we can consider ourselves done now.
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- int top_y = height_to_pixel(overall_time);
|
|
|
- _pixmap.draw_line(get_collector_gc(cd._collector_index), x, y, x, top_y);
|
|
|
- y = top_y;
|
|
|
+ int top_y = height_to_pixel(overall_time);
|
|
|
+ _pixmap.draw_line(get_collector_gc(cd._collector_index), x, y, x, top_y);
|
|
|
+ y = top_y;
|
|
|
+ }
|
|
|
+ x++;
|
|
|
+ w--;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -215,8 +219,12 @@ draw_slice(int x, int frame_number) {
|
|
|
// Description: Draws a single vertical slice of background color.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GtkStatsStripChart::
|
|
|
-draw_empty(int x) {
|
|
|
- _pixmap.draw_line(_white_gc, x, 0, x, get_ysize());
|
|
|
+draw_empty(int x, int w) {
|
|
|
+ while (w > 0) {
|
|
|
+ _pixmap.draw_line(_white_gc, x, 0, x, get_ysize());
|
|
|
+ x++;
|
|
|
+ w--;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|