Skip to content

Commit

Permalink
fix bug with unselected selection
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfig committed Dec 23, 2024
1 parent 556af14 commit 0ab7136
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 2 additions & 4 deletions quadratic-client/src/app/gridGL/UI/drawCursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ export const drawFiniteSelection = (g: Graphics, color: number, alpha: number, r
const startY = Math.min(Number(start.row.coord), Number(end.row.coord));
const width = Math.abs(Number(end.col.coord) - Number(start.col.coord)) + 1;
const height = Math.abs(Number(end.row.coord) - Number(start.row.coord)) + 1;
if (width > 1 || height > 1) {
const rect = sheet.getScreenRectangle(startX, startY, width, height);
g.drawShape(rect);
}
const rect = sheet.getScreenRectangle(startX, startY, width, height);
g.drawShape(rect);
}
});
g.endFill();
Expand Down
15 changes: 15 additions & 0 deletions quadratic-core/src/a1/a1_selection/a1_selection_exclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,19 @@ mod test {
vec![CellRefRange::test_a1("B7:C7"), CellRefRange::test_a1("B8")]
);
}

#[test]
fn test_3x3_exclude_middle() {
let mut selection = A1Selection::test_a1("A1:C3");
selection.exclude_cells(pos![B2], None);
assert_eq!(
selection.ranges,
vec![
CellRefRange::test_a1("A1:C1"),
CellRefRange::test_a1("A3:C3"),
CellRefRange::test_a1("A2"),
CellRefRange::test_a1("C2"),
]
);
}
}

0 comments on commit 0ab7136

Please sign in to comment.