Prevent drawing the graph if it is too small (Gtk2)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user