Menu

#2 Update ScrollBar after scroll.

open
nobody
None
5
2009-04-08
2009-04-08
Anonymous
No

In file SWTJGraphScrollPane.java

public void scrollTo(int hVal, int vVal) {
int xDiff = (int) (m_graphArea.getX() * -1);
int yDiff = (int) (m_graphArea.getY() * -1);

Point2D point = new Point2D.Double(hVal - xDiff, vVal - yDiff);
m_graphPane.getLens().undoLens(m_graphPane, new Point2D.Double(0, 0));
m_translateLens.setTranslate(-point.getX(), -point.getY());
}

should probably be:

public void scrollTo(int hVal, int vVal) {
int xDiff = (int) (m_graphArea.getX() * -1);
int yDiff = (int) (m_graphArea.getY() * -1);

Point2D point = new Point2D.Double(hVal - xDiff, vVal - yDiff);
m_graphPane.getLens().undoLens(m_graphPane, new Point2D.Double(0, 0));
m_translateLens.setTranslate(-point.getX(), -point.getY());
m_horizontalScrollBar.setSelection(hVal);
m_verticalScrollBar.setSelection(vVal);
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB