瀏覽代碼

Debounced the data_changed handler so as to not overload any listeners. Fixes sever slowdown in CTRLPainter.

dev-bank
Bryan Miller 5 年之前
父節點
當前提交
0d4808dbd4
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      app/js/models/NESBank.js

+ 2
- 2
app/js/models/NESBank.js 查看文件

@@ -38,12 +38,12 @@ export default class NESBank extends ISurface{
this.__RP = []; // Right Patterns (Backgrounds)
this.__AccessMode = 2; // 0 = Sprites only | 1 = BG only | 2 = Sprites and BG

var handle_datachanged = function(side){
var handle_datachanged = Utils.debounce((function(side){
if ((side == 0 && (this.__AccessMode == 0 || this.__AccessMode == 2)) ||
(side == 1 && (this.__AccessMode == 1 || this.__AccessMode == 2))){
this.emit("data_changed");
}
}
}).bind(this), 250);

for (var i=0; i < 256; i++){
this.__LP.push(new NESTile());

Loading…
取消
儲存