Prevent drawing the graph if it is too small (Gtk2)

This commit is contained in:
Simon Steinbeiss
2014-12-19 11:50:47 +01:00
parent b55c97c52e
commit 016168ac83

View File

@@ -223,6 +223,9 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor, cairo_t *cr)
#else
width = GTK_WIDGET (monitor)->allocation.width;
height = GTK_WIDGET (monitor)->allocation.height;
/* Don't draw anything if the graph is too small */
if (height < 3)
return;
#endif
/* Paint the graph's background box */
@@ -297,4 +300,4 @@ xtm_process_monitor_clear (XtmProcessMonitor *monitor)
g_array_set_size (monitor->history, 0);
if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor))))
gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE);
}
}