Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Question about the ViewportLayer moveColumnPositionIntoViewport method(Why does the moveColumnPositionIntoViewport use cell borders to calculate the viewport?)
Question about the ViewportLayer moveColumnPositionIntoViewport method [message #1269996] Wed, 12 March 2014 11:38 Go to next message
David Bräutigam is currently offline David BräutigamFriend
Messages: 1
Registered: March 2014
Junior Member

I recognized a odd behavior in the ViewportLayer. When my table is scrolled to the right end and I am going back a cell to the left, the viewport is also scrolled back a cell so that the last cell will be out of the viewport.

I tracked this behavior down to the ViewportLayer.moveColumnPositionIntoViewport method. There the viewportEndX is calculated with the leftmost cell border and not with the absolute position of the origin.

int viewportEndX = underlyingLayer.getStartXOfColumnPosition(getOriginColumnPosition()) + clientAreaWidth;

Because of this the viewport will be scrolled to the left, hiding the last cells, as long as the leftmost cell is not fully visible.

With this code the table would remain scrolled to the right until a cell on the right is selected which is not fully visible.

int viewportEndX = getOrigin().getX() + clientAreaWidth;

So I would like to know is this a bug or is this intentional?
Re: Question about the ViewportLayer moveColumnPositionIntoViewport method [message #1270047 is a reply to message #1269996] Wed, 12 March 2014 12:47 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2751
Registered: July 2012
Senior Member
Seems the moveXxxPositionIntoViewport methods were not updated correctly after the modification for smooth scrolling.

Thanks for the fix proposal, pushed that change for column and row handling to core.
Previous Topic:SelectionLayer and SelectionModel: Performance troubles
Next Topic:Supported formats
Goto Forum:

Current Time: Sat Dec 07 12:04:59 GMT 2019

Powered by FUDForum. Page generated in 1.23020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top