diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-04-18 18:12:30 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-04-18 18:12:30 -0400 |
commit | da318411dca2e47d3327d10dac0408bf40a4abb0 (patch) | |
tree | 750aa036fe82db58fbcfd8abb3144b4c86128cfa | |
parent | 35cc52f41896ca8d06b905310154d186a18ddb02 (diff) | |
download | gtk+-da318411dca2e47d3327d10dac0408bf40a4abb0.tar.gz |
Fixed bug in gtk_extended_get_desired_size().
gtk_extended_get_desired_size() was mixing up orientations based
on the preference, considering ditching the preference anyway.
Also slightly enhanced debug prints.
-rw-r--r-- | gtk/gtkextendedlayout.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/gtk/gtkextendedlayout.c b/gtk/gtkextendedlayout.c index f08fced34e..96e071b07d 100644 --- a/gtk/gtkextendedlayout.c +++ b/gtk/gtkextendedlayout.c @@ -252,12 +252,14 @@ compute_size_for_orientation (GtkExtendedLayout *layout, g_assert (cached_size->minimum_size <= cached_size->natural_size); #if DEBUG_EXTENDED_LAYOUT - g_message ("%s size for orientation %s: %d is minimum %d and natural: %d", - G_OBJECT_TYPE_NAME (layout), - orientation == GTK_SIZE_GROUP_HORIZONTAL ? "horizontal" : "vertical", + g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d (hit cache: %s)\n", + layout, G_OBJECT_TYPE_NAME (layout), + orientation == GTK_SIZE_GROUP_HORIZONTAL ? + "width for height" : "height for width" , for_size, cached_size->minimum_size, - cached_size->natural_size); + cached_size->natural_size, + found_in_cache ? "yes" : "no"); #endif } @@ -406,34 +408,26 @@ gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout, G_OBJECT_TYPE_NAME (layout), min_height, nat_width); #endif - - /* The minimum size here is the minimum height for the natrual width */ - if (minimum_size) - { - minimum_size->width = min_width; - minimum_size->height = min_height; - } } else { gtk_extended_layout_get_desired_height (layout, &min_height, &nat_height); - gtk_extended_layout_get_height_for_width (layout, min_height, &min_width, &nat_width); + gtk_extended_layout_get_width_for_height (layout, min_height, &min_width, &nat_width); #if DEBUG_EXTENDED_LAYOUT g_message ("%s get_desired_size min width: %d for natural height: %d", G_OBJECT_TYPE_NAME (layout), min_width, nat_height); #endif - - /* The minimum size here is the minimum width for the natrual height */ - if (minimum_size) - { - minimum_size->width = min_width; - minimum_size->height = min_height; - } } + if (minimum_size) + { + minimum_size->width = min_width; + minimum_size->height = min_height; + } + if (natural_size) { natural_size->width = nat_width; |