You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2020/01/31 09:48:25 UTC
[sis] branch geoapi-4.0 updated: Revert "An attempt to fix the
problem of cells sometime missing in header rows the fist time that the
grid is shown." It did not worked better. Since the problem appears only in
some occasions and disappear on the first scrolling action,
we leave it as it for now. This reverts commit
3605f9aa45fd9e71071f873a70e3caa4e63bc1b8.
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 0bbdf79 Revert "An attempt to fix the problem of cells sometime missing in header rows the fist time that the grid is shown." It did not worked better. Since the problem appears only in some occasions and disappear on the first scrolling action, we leave it as it for now. This reverts commit 3605f9aa45fd9e71071f873a70e3caa4e63bc1b8.
0bbdf79 is described below
commit 0bbdf7992976a4d28e5db707500bcd2ce0009879
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Fri Jan 31 10:41:56 2020 +0100
Revert "An attempt to fix the problem of cells sometime missing in header rows the fist time that the grid is shown."
It did not worked better. Since the problem appears only in some occasions and disappear on the first scrolling action,
we leave it as it for now.
This reverts commit 3605f9aa45fd9e71071f873a70e3caa4e63bc1b8.
---
.../main/java/org/apache/sis/gui/coverage/GridViewSkin.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 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 412cfd5..e40f577 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
@@ -339,6 +339,7 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow> {
final double headerHeight = flow.getFixedCellSize() + 2*cellSpacing;
final double dataY = y + headerHeight;
final double dataHeight = height - headerHeight;
+ final boolean resized = (flow.getWidth() != width) || (flow.getHeight() != dataHeight);
flow.resizeRelocate(x, dataY, width, dataHeight);
/*
* Recompute all values which will be needed by GridRowSkin. They are mostly information about
@@ -373,10 +374,11 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow> {
* detected (in which case values changed), or because the view size changed (in which case cells
* may need to be added or removed).
*/
- final ObservableList<Node> children = headerRow.getChildren();
- final int count = children.size();
- final int missing = (int) Math.ceil((width - headerWidth) / cellWidth) - count;
- if (missing != 0 || oldPos != leftPosition) {
+ if (resized || oldPos != leftPosition) {
+ layoutInArea(headerRow, x, y, width, headerHeight, Node.BASELINE_OFFSET_SAME_AS_HEIGHT, HPos.LEFT, VPos.TOP);
+ final ObservableList<Node> children = headerRow.getChildren();
+ final int count = children.size();
+ final int missing = (int) Math.ceil((width - headerWidth) / cellWidth) - count;
if (missing != 0) {
if (missing < 0) {
children.remove(missing + count, count); // Too many children. Remove the extra ones.
@@ -390,7 +392,6 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow> {
}
children.addAll(more); // Single addAll(…) operation for sending only one event.
}
- layoutInArea(headerRow, x, y, width, headerHeight, Node.BASELINE_OFFSET_SAME_AS_HEIGHT, HPos.LEFT, VPos.TOP);
}
double pos = x + headerWidth;
int column = firstVisibleColumn;