code: function normPos(
      x: number,
      y: number,
      width: number,
      height: number
  ): number[] {
      if (x < 0) {
          x = width - 1;
          y -= 1;
      }
  
      if (y < 0) {
          return [-1, -1];
      }
  
      if (x >= width) {
          x = 0;
          y += 1;
      }
  
      if (y >= height) {
          return [-1, -1];
      }
  
      return [x, y];
  }
docs: Normalize position in a table. If x is out of the row, update y accordingly.
  Returns [-1, -1] if the new selection is out of table