{"size": 371, "ext": "js", "max_stars_repo_path": "my-app/src/utils/drawCanvasOriginal.js", "max_stars_repo_name": "taenykim/interactive-pixelator-page", "max_stars_repo_stars_event_min_datetime": "2020-08-19T00:38:01.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-19T00:38:01.000Z", "max_issues_repo_path": "my-app/src/utils/drawCanvasOriginal.js", "max_issues_repo_name": "taenykim/interactive-pixelator-page", "max_issues_repo_issues_event_min_datetime": "2021-10-06T18:40:44.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T06:35:19.000Z", "max_forks_repo_path": "my-app/src/utils/drawCanvasOriginal.js", "max_forks_repo_name": "taenykim/interactive-pixelator-page", "max_forks_repo_forks_event_min_datetime": "2020-08-19T00:38:01.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-19T00:38:01.000Z"}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": 1, "avg_line_length": 28.5384615385, "max_line_length": 54, "alphanum_fraction": 0.6873315364}
import { resizeImage } from "./resizeImage";

const borderSize = 2;

export const drawCanvasOriginal = (canvas, image) => {
  const ctx = canvas.getContext("2d");
  const [width, height] = resizeImage(image);
  canvas.width = width - borderSize;
  canvas.height = height - borderSize;
  ctx.clearRect(0, 0, width, height);
  ctx.drawImage(image, 0, 0, width, height);
};
