[gtk+/overlay: 27/34] Fix GtkOverlay size allocation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 27/34] Fix GtkOverlay size allocation
- Date: Sat, 11 Jun 2011 01:00:55 +0000 (UTC)
commit cf6b256ebd683ebc8db12c25b73c32f594b7c778
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 10 19:45:55 2011 -0400
Fix GtkOverlay size allocation
The code was not handling non-zero positions correctly, as
shown by the testoverlay testcase.
gtk/gtkoverlay.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 5aa7392..e912d6d 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -244,8 +244,8 @@ gtk_overlay_size_allocate (GtkWidget *widget,
return;
/* main widget allocation */
- main_alloc.x = 0;
- main_alloc.y = 0;
+ main_alloc.x = allocation->x;
+ main_alloc.y = allocation->y;
main_alloc.width = allocation->width;
main_alloc.height = allocation->height;
@@ -305,6 +305,8 @@ gtk_overlay_size_allocate (GtkWidget *widget,
break;
}
+ alloc.x += allocation->x;
+ alloc.y += allocation->y;
alloc.width = MIN (main_alloc.width, req.width);
alloc.height = MIN (main_alloc.height, req.height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]