mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-28 17:32:29 +01:00
fixed bug in ScrollTableViewRowToVisible
This commit is contained in:
@@ -233,8 +233,8 @@ static void scrollToPoint(WMTableView *table, int x, int y)
|
|||||||
float value, prop;
|
float value, prop;
|
||||||
|
|
||||||
if (size.width > W_VIEW_WIDTH(table->tableView)) {
|
if (size.width > W_VIEW_WIDTH(table->tableView)) {
|
||||||
prop = (float)size.width / (float)W_VIEW_WIDTH(table->tableView);
|
prop = (float)W_VIEW_WIDTH(table->tableView) / (float)size.width;
|
||||||
value = x * (float)(size.width - W_VIEW_WIDTH(table->tableView));
|
value = (float)x / (float)(size.width - W_VIEW_WIDTH(table->tableView));
|
||||||
} else {
|
} else {
|
||||||
prop = 1.0;
|
prop = 1.0;
|
||||||
value = 0.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)) {
|
if (size.height > W_VIEW_HEIGHT(table->tableView)) {
|
||||||
prop = (float)size.height / (float)W_VIEW_HEIGHT(table->tableView);
|
prop = (float)W_VIEW_HEIGHT(table->tableView) / (float)size.height;
|
||||||
value = y * (float)(size.height - W_VIEW_HEIGHT(table->tableView));
|
value = (float)y / (float)(size.height - W_VIEW_HEIGHT(table->tableView));
|
||||||
} else {
|
} else {
|
||||||
prop = 1.0;
|
prop = 1.0;
|
||||||
value = 0.0;
|
value = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMSetScrollerParameters(table->vscroll, value, prop);
|
WMSetScrollerParameters(table->vscroll, value, prop);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user