Add tests

This commit is contained in:
Daniel Imms
2018-11-16 17:54:03 -08:00
parent 774793c7ca
commit a480f483cd
2 changed files with 17 additions and 0 deletions
+4
View File
@@ -289,6 +289,10 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
return false;
}
return this._areCoordsInSelection(coords, start, end);
}
protected _areCoordsInSelection(coords: [number, number], start: [number, number], end: [number, number]): boolean {
return (coords[1] > start[1] && coords[1] < end[1]) ||
(start[1] === end[1] && coords[1] === start[1] && coords[0] >= start[0] && coords[0] < end[0]) ||
(start[1] < end[1] && coords[1] === end[1] && coords[0] < end[0]) ||