Users should be able to select points (not just lines) (#97)

* update selection datastructure to accomodate more selection metadata

* Users should be able to select points (not just lines)
This commit is contained in:
Kurt Hutten
2023-04-03 16:05:25 +10:00
committed by GitHub
parent 7013eb861d
commit a8b68bab6a
25 changed files with 292 additions and 146 deletions

View File

@ -1,5 +1,5 @@
import { isOverlap, roundOff } from './utils'
import { Range } from '../useStore'
import { SourceRange } from '../lang/executor'
describe('testing isOverlapping', () => {
testBothOrders([0, 3], [3, 10])
@ -11,7 +11,7 @@ describe('testing isOverlapping', () => {
testBothOrders([0, 5], [-2, -1], false)
})
function testBothOrders(a: Range, b: Range, result = true) {
function testBothOrders(a: SourceRange, b: SourceRange, result = true) {
it(`test is overlapping ${a} ${b}`, () => {
expect(isOverlap(a, b)).toBe(result)
expect(isOverlap(b, a)).toBe(result)