src/UI/pen.js
function savePoint(x, y) {
  let svg = findSVGAtPoint(x, y);
  if (!svg) {
    return;
  }

  let rect = svg.getBoundingClientRect();
  let point = scaleDown(svg, {
    x: x - rect.left,
    y: y - rect.top
  });

  lines.push([point.x, point.y]);

  if (lines.length <= 1) {
    return;
  }

  if (path) {
    svg.removeChild(path);
  }

  path = appendChild(svg, {
    type: 'drawing',
    color: _penColor,
    width: _penSize,
    lines
  });
}
function savePoint(x, y) {
  let svg = findSVGAtPoint(x, y);
  if (!svg) {
    return;
  }

  let rect = svg.getBoundingClientRect();
  let point = scaleDown(svg, {
    x: x - rect.left,
    y: y - rect.top
  });

  lines.push([point.x, point.y]);

  if (lines.length <= 1) {
    return;
  }

  if (path) {
    svg.removeChild(path);
  }

  path = appendChild(svg, {
    type: 'drawing',
    color: _penColor,
    width: _penSize,
    lines
  });
}
function savePoint ( x , y ) { let svg = findSVGAtPoint ( x , y ) ; if ( ! svg ) { return ; } let rect = svg . getBoundingClientRect ( ) ; let point = scaleDown ( svg , { x : x - rect . left , y : y - rect . top } ) ; lines . push ( [ point . x , point . y ] ) ; if ( lines . length <= 1 ) { return ; } if ( path ) { svg . removeChild ( path ) ; } path = appendChild ( svg , { type : 'drawing' , color : _penColor , width : _penSize , lines } ) ; }
Save a point to the line being drawn.

@param {Number} x The x coordinate of the point
@param {Number} y The y coordinate of the point
Save a point to the line being drawn .