[gtk+] tests: Fix height checks in treeview scrolling test
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Fix height checks in treeview scrolling test
- Date: Mon, 6 Feb 2012 19:43:22 +0000 (UTC)
commit 33961154b6cdf75816655a0500e3788418c670d2
Author: Benjamin Otte <otte redhat com>
Date: Mon Feb 6 19:50:11 2012 +0100
tests: Fix height checks in treeview scrolling test
If things get centered in the scrolling area depens on the height of the
row, too.
gtk/tests/treeview-scrolling.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/tests/treeview-scrolling.c b/gtk/tests/treeview-scrolling.c
index 3e28d4b..0c123f9 100644
--- a/gtk/tests/treeview-scrolling.c
+++ b/gtk/tests/treeview-scrolling.c
@@ -350,7 +350,7 @@ assert_position_with_align (GtkTreeView *tree_view,
case 1:
/* 0.5 */
if (pos == POS_TOP
- && row_start < gtk_adjustment_get_page_size (vadjustment) / 2) {
+ && row_start < (gtk_adjustment_get_page_size (vadjustment) - row_height) / 2) {
/* For the first half of the top view we can't
* center the row in the view, instead we
* show the first page.
@@ -358,7 +358,7 @@ assert_position_with_align (GtkTreeView *tree_view,
*/
g_assert (gtk_adjustment_get_value (vadjustment) == 0);
} else if (pos == POS_BOTTOM
- && row_start >= gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment) / 2) {
+ && row_start + row_height >= gtk_adjustment_get_upper (vadjustment) - (gtk_adjustment_get_page_size (vadjustment) - row_height) / 2) {
/* For the last half of the bottom view we
* can't center the row in the view, instead
* we show the last page.
@@ -375,7 +375,7 @@ assert_position_with_align (GtkTreeView *tree_view,
* (ie. the row's center is at the
* center of the view).
*/
- gdouble middle = gtk_adjustment_get_page_size (vadjustment) / 2 - row_height / 2;
+ gdouble middle = (gtk_adjustment_get_page_size (vadjustment) - row_height) / 2.0;
g_assert (row_y == ceil (middle) || row_y == floor (middle));
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]