MCPcopy Create free account
hub / github.com/bwasti/mebm / constructor

Method constructor

script.js:463–478  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

461
462class ImageLayer extends MoveableLayer {
463 constructor(file) {
464 super(file);
465 // assume images are 10 seconds
466 this.img = new Image();
467
468 this.reader = new FileReader();
469 this.reader.addEventListener("load", (function() {
470 this.img.src = this.reader.result;
471 this.img.addEventListener('load', (function() {
472 this.width = this.img.naturalWidth;
473 this.height = this.img.naturalHeight;
474 this.ready = true;
475 }).bind(this));
476 }).bind(this), false);
477 this.reader.readAsDataURL(file);
478 }
479
480 render(ctx_out, ref_time) {
481 if (!this.ready) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected