From 60611fbd4753e2c23f4c2b34ef546ff6d645e333 Mon Sep 17 00:00:00 2001 From: kojima Date: Fri, 18 May 2001 17:07:18 +0000 Subject: [PATCH] fixed bug in ScrollTableViewRowToVisible --- WINGs/Extras/wtableview.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/WINGs/Extras/wtableview.c b/WINGs/Extras/wtableview.c index 7001bc36..865537b7 100644 --- a/WINGs/Extras/wtableview.c +++ b/WINGs/Extras/wtableview.c @@ -233,8 +233,8 @@ static void scrollToPoint(WMTableView *table, int x, int y) float value, prop; if (size.width > W_VIEW_WIDTH(table->tableView)) { - prop = (float)size.width / (float)W_VIEW_WIDTH(table->tableView); - value = x * (float)(size.width - W_VIEW_WIDTH(table->tableView)); + prop = (float)W_VIEW_WIDTH(table->tableView) / (float)size.width; + value = (float)x / (float)(size.width - W_VIEW_WIDTH(table->tableView)); } else { prop = 1.0; value = 0.0; @@ -243,12 +243,13 @@ static void scrollToPoint(WMTableView *table, int x, int y) if (size.height > W_VIEW_HEIGHT(table->tableView)) { - prop = (float)size.height / (float)W_VIEW_HEIGHT(table->tableView); - value = y * (float)(size.height - W_VIEW_HEIGHT(table->tableView)); + prop = (float)W_VIEW_HEIGHT(table->tableView) / (float)size.height; + value = (float)y / (float)(size.height - W_VIEW_HEIGHT(table->tableView)); } else { prop = 1.0; value = 0.0; } + WMSetScrollerParameters(table->vscroll, value, prop); -- 2.11.4.GIT