From 6878910ad47cd711e40259e399409da19008cd96 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 21 Jan 1999 21:06:13 +0000 Subject: Code cleanup. Thu Jan 21 16:03:02 1999 Owen Taylor * gtk/gtkbutton.c (gtk_button_expose): Code cleanup. * gtk/gtktree.c: Add a paint routine, fix up bugs in drawing where if the expose area was contained completely in the right side of the tree the background wasn't redraw, etc. * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug in clipping draw regions while propagating them upwards. --- gtk/gtkbutton.c | 10 +++++----- gtk/gtkwidget.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 44475d64f..60e6dbf66 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -636,7 +636,7 @@ static gint gtk_button_expose (GtkWidget *widget, GdkEventExpose *event) { - GtkButton *button; + GtkButton *bin; GdkEventExpose child_event; g_return_val_if_fail (widget != NULL, FALSE); @@ -645,14 +645,14 @@ gtk_button_expose (GtkWidget *widget, if (GTK_WIDGET_DRAWABLE (widget)) { - button = GTK_BUTTON (widget); + bin = GTK_BIN (widget); gtk_button_paint (widget, &event->area); child_event = *event; - if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) && - gtk_widget_intersect (GTK_BIN (button)->child, &event->area, &child_event.area)) - gtk_widget_event (GTK_BIN (button)->child, (GdkEvent*) &child_event); + if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) && + gtk_widget_intersect (bin->child, &event->area, &child_event.area)) + gtk_widget_event (bin->child, (GdkEvent*) &child_event); } return FALSE; diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 5bb11e08f..b73581e95 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1971,12 +1971,12 @@ gtk_widget_clip_rect (GtkWidget *widget, if (rect->x < 0) { - rect->width = (width > -rect->x) ? width + rect->x : 0; + rect->width = (rect->width > -rect->x) ? rect->width + rect->x : 0; rect->x = 0; } if (rect->y < 0) { - rect->height = (height > -rect->y) ? width + rect->y : 0; + rect->height = (rect->height > -rect->y) ? rect->width + rect->y : 0; rect->y = 0; } if (rect->x + rect->width > width) -- cgit v1.2.1