This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new b4ba732 Fix an horizontal offset in the selected cell.
b4ba732 is described below
commit b4ba732de2b2444de3b8c2aef2a7cea9ef74f8ad
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Mon Feb 3 15:54:27 2020 +0100
Fix an horizontal offset in the selected cell.
---
.../main/java/org/apache/sis/gui/coverage/GridViewSkin.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git
a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
index b9b5dd6..5fdf06a 100644
---
a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
+++
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
@@ -199,23 +199,22 @@ final class GridViewSkin extends
VirtualContainerBase<GridView, GridRow> impleme
*/
@Override
public final void handle(final MouseEvent event) {
- final double tx = leftBackground.getWidth();
- double x = event.getX() - tx;
+ double x = event.getX() - (leftPosition + headerWidth);
boolean visible = (x >= 0);
if (visible) {
- final int column = (int) (x / cellWidth);
- visible = (column >= firstVisibleColumn);
+ final double visibleColumn = Math.floor(x / cellWidth);
+ visible = (visibleColumn >= 0);
if (visible) {
final GridRow row = (GridRow) event.getSource();
double y = row.getLayoutY();
visible = y < getVirtualFlow().getHeight();
if (visible) {
- x = (column - firstVisibleColumn) * cellWidth + tx;
+ x = visibleColumn * cellWidth + leftBackground.getWidth()
+ row.getLayoutX();
y += topBackground.getHeight();
selection.relocate(x, y);
selectedRow.setY(y);
selectedColumn.setX(x);
- statusBar.setCoordinates(column, row.getIndex());
+ statusBar.setCoordinates(((int) visibleColumn) +
firstVisibleColumn, row.getIndex());
}
}
}