mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: clamp rectangle to visible area
This commit is contained in:
@ -181,6 +181,15 @@ sysprof_time_span_layer_snapshot (GtkWidget *widget,
|
|||||||
if (rect.size.width == 0)
|
if (rect.size.width == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (rect.origin.x < 0)
|
||||||
|
{
|
||||||
|
rect.size.width -= ABS (rect.origin.x);
|
||||||
|
rect.origin.x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rect.origin.x + rect.size.width > width)
|
||||||
|
rect.size.width = width - rect.origin.x;
|
||||||
|
|
||||||
gtk_snapshot_append_color (snapshot, color, &rect);
|
gtk_snapshot_append_color (snapshot, color, &rect);
|
||||||
|
|
||||||
if (rect.size.width > 20)
|
if (rect.size.width > 20)
|
||||||
|
|||||||
Reference in New Issue
Block a user