提交 51e9a0c6 编写于 作者: S Serge Rider

#1721 Grid columns selection fix


Former-commit-id: e307ca13
上级 8cc1b074
......@@ -3171,33 +3171,46 @@ public abstract class LightGrid extends Canvas {
showItem(intentItem);
selectionEvent = updateCellSelection(cells, ctrlFlag, true, false, EventSource.MOUSE);
}
final GridColumn prevHoveringColumn = hoveringColumn;
if (cellColumnDragSelectionOccurring && handleCellHover(e.x, e.y)) {
GridColumn intentCol = hoveringColumn;
if (intentCol == null) return; //temporary
boolean dragging;
List<GridPos> newSelected = new ArrayList<>();
GridColumn iterCol = intentCol;
GridColumn iterCol = hoveringColumn;
if (iterCol != null) {
boolean decreasing = (indexOf(iterCol) > indexOf(focusColumn));
dragging = true;
List<GridPos> newSelected = new ArrayList<>();
while (iterCol != null) {
getCells(iterCol, newSelected);
boolean decreasing = (indexOf(iterCol) > indexOf(focusColumn));
if (iterCol == focusColumn) {
break;
}
while (iterCol != null) {
getCells(iterCol, newSelected);
if (decreasing) {
iterCol = getPreviousVisibleColumn(iterCol);
} else {
iterCol = getNextVisibleColumn(iterCol);
}
if (iterCol == focusColumn) {
break;
}
if (decreasing) {
iterCol = getPreviousVisibleColumn(iterCol);
} else {
dragging = false;
if (e.x <= rowHeaderWidth) {
GridColumn prev = prevHoveringColumn == null ? null : getPreviousVisibleColumn(prevHoveringColumn);
if (prev != null) {
showColumn(prev);
getCells(prev, newSelected);
ctrlFlag = SWT.MOD1;
}
} else {
iterCol = getNextVisibleColumn(iterCol);
}
}
selectionEvent = updateCellSelection(newSelected, ctrlFlag, true, false, EventSource.MOUSE);
selectionEvent = updateCellSelection(newSelected, ctrlFlag, dragging, false, EventSource.MOUSE);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册