diff --git a/quadratic-client/src/app/gridGL/UI/drawCursor.ts b/quadratic-client/src/app/gridGL/UI/drawCursor.ts index 66e166e347..bf127fea17 100644 --- a/quadratic-client/src/app/gridGL/UI/drawCursor.ts +++ b/quadratic-client/src/app/gridGL/UI/drawCursor.ts @@ -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(); diff --git a/quadratic-core/src/a1/a1_selection/a1_selection_exclude.rs b/quadratic-core/src/a1/a1_selection/a1_selection_exclude.rs index 9f81e09147..88353e52e2 100644 --- a/quadratic-core/src/a1/a1_selection/a1_selection_exclude.rs +++ b/quadratic-core/src/a1/a1_selection/a1_selection_exclude.rs @@ -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"), + ] + ); + } }