Просмотр исходного кода

CTRLPainter watching window resize. Using Debounce.

dev-tmpl
Bryan Miller 7 лет назад
Родитель
Сommit
7fe55cd661
1 измененных файлов: 7 добавлений и 1 удалений
  1. +7
    -1
      app/js/ui/CTRLPainter.js

+ 7
- 1
app/js/ui/CTRLPainter.js Просмотреть файл

import Utils from "/app/js/Utils.js";
import GlobalEvents from "/app/js/EventCaller.js"; import GlobalEvents from "/app/js/EventCaller.js";


const EL_CANVAS_ID = "painter"; const EL_CANVAS_ID = "painter";
throw new Error("Failed to obtain canvas context."); throw new Error("Failed to obtain canvas context.");


//var imgdata = this.__context.getImageData(); //var imgdata = this.__context.getImageData();
console.log(this.__canvas.width + ", " + this.__canvas.height);
var handle_resize = Utils.debounce((function(){
console.log("DEBOUNCED");
console.log(this.__canvas.width + ", " + this.__canvas.height);
console.log(this.__canvas.clientWidth + ", " + this.__canvas.height);
}).bind(this), 250);
window.addEventListener("resize", handle_resize);
} }


get scale(){ get scale(){

Загрузка…
Отмена
Сохранить