function insertLine(x0, y0, x1, y1) {
  const base = 8 * this.cr;
  const batch = this.getCurrentDrawingBatch();
  const dx = Math.abs(x1 - x0); const dy = Math.abs(y1 - y0);
  const sx = (x0 < x1) ? 1 : -1; const sy = (y0 < y1) ? 1 : -1;
  let err = (dx - dy);
  while (true) {
    const relative = this.getRelativeTileOffset(x0, y0);
    // TODO: limit repeation rate on brush size (take modulo)
    if (this.states.drawing) {
      batch.drawAt(relative.x, relative.y, SETTINGS.PENCIL_SIZE, this.fillStyle);
    }
    else if (this.states.erasing) {
      batch.clearAt(relative.x, relative.y, SETTINGS.ERASER_SIZE);
    }
    else if (this.states.lighting) {
      batch.applyColorLightness(relative.x, relative.y, SETTINGS.LIGHTING_MODE);
    }
    else if (this.states.stroke) {
      batch.drawAt(x0, y0, SETTINGS.PENCIL_SIZE, this.fillStyle);
    }
    if (x0 === x1 && y0 === y1) break;
    const e2 = 2 * err;
    if (e2 > -dy) { err -= dy; x0 += sx; }
    if (e2 < dx) { err += dx; y0 += sy; }
  };
}
@param {Number} x0
@param {Number} y0
@param {Number} x1
@param {Number} y1