summaryrefslogtreecommitdiff
path: root/gtk/gtkcurve.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcurve.c')
-rw-r--r--gtk/gtkcurve.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c
index 345925b0f7..169c885bbf 100644
--- a/gtk/gtkcurve.c
+++ b/gtk/gtkcurve.c
@@ -294,6 +294,9 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c)
width = w->allocation.width - RADIUS * 2;
height = w->allocation.height - RADIUS * 2;
+ if ((width < 0) || (height < 0))
+ return FALSE;
+
/* get the pointer position */
gdk_window_get_pointer (w->window, &tx, &ty, NULL);
x = CLAMP ((tx - RADIUS), 0, width-1);