mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: ignore out-of-sequence data
We shouldn't be getting this here, but drop it if we do come across it so that we don't screw up path drawing.
This commit is contained in:
@ -115,6 +115,12 @@ sysprof_line_layer_snapshot (GtkWidget *widget,
|
|||||||
float x = floor (x_values[i] * width);
|
float x = floor (x_values[i] * width);
|
||||||
float y = floor (y_values[i] * height);
|
float y = floor (y_values[i] * height);
|
||||||
|
|
||||||
|
/* Skip if we are getting data incorrectly on the X axis.
|
||||||
|
* It should have been sorted by this point.
|
||||||
|
*/
|
||||||
|
if (x < last_x)
|
||||||
|
continue;
|
||||||
|
|
||||||
cairo_curve_to (cr,
|
cairo_curve_to (cr,
|
||||||
last_x + ((x - last_x)/2),
|
last_x + ((x - last_x)/2),
|
||||||
last_y,
|
last_y,
|
||||||
@ -134,6 +140,12 @@ sysprof_line_layer_snapshot (GtkWidget *widget,
|
|||||||
float x = floor (x_values[i] * width);
|
float x = floor (x_values[i] * width);
|
||||||
float y = floor (y_values[i] * height);
|
float y = floor (y_values[i] * height);
|
||||||
|
|
||||||
|
/* Skip if we are getting data incorrectly on the X axis.
|
||||||
|
* It should have been sorted by this point.
|
||||||
|
*/
|
||||||
|
if (x < last_x)
|
||||||
|
continue;
|
||||||
|
|
||||||
cairo_line_to (cr, x, y);
|
cairo_line_to (cr, x, y);
|
||||||
|
|
||||||
last_x = x;
|
last_x = x;
|
||||||
|
|||||||
Reference in New Issue
Block a user