MCPcopy Index your code
hub / github.com/devforth/painterro / openFile

Method openFile

js/main.js:1350–1357  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

1348 }
1349
1350 openFile(f) {
1351 if (!f) {
1352 return;
1353 }
1354 this.loadedName = trim((f.name || '').replace(/\..+$/, ''));
1355 const dataUrl = (window.URL ? window.URL : window.webkitURL).createObjectURL(f);
1356 this.loadImage(dataUrl, f.type);
1357 }
1358
1359 getScale() {
1360 return this.canvas.getAttribute('width') / this.canvas.offsetWidth;

Callers 2

constructorMethod · 0.95
initEventHandlersMethod · 0.95

Calls 2

loadImageMethod · 0.95
trimFunction · 0.90

Tested by

no test coverage detected