From 62de603571b2bea7dd980022657f595a0eb7e6a1 Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Mon, 6 Nov 2006 23:34:21 +0000 Subject: [PATCH] Bug 142067 - fixed calculation of the index of the table item that lives at the top row of the table. --- .../eclipse/rse/shells/ui/view/SystemCommandsView.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java index 1c40d0cc462..feb3b56dc6d 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java @@ -190,10 +190,10 @@ public class SystemCommandsView extends SystemTableView implements ISystemThemeC } } } - if (index > 0) - { - table.setTopIndex(index - 1); - } + int y = table.getSize().y; + int h = table.getItemHeight(); + int n = y / h - 1; + table.setTopIndex(Math.max(0, index - n)); } } if (needsLayout)