Explorar el Código

NESBank.snapshot() was not intended to remain debounced. Method .snapshot() will now clear redo history if any.

dev
Bryan Miller hace 5 años
padre
commit
24146baf34
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      app/js/models/NESBank.js

+ 3
- 1
app/js/models/NESBank.js Ver fichero

@@ -91,7 +91,6 @@ export default class NESBank extends ISurface{
this.__redos = []; // Holds Base64 snapshots of work undone.

this.__emitsEnabled = true;
this.snapshot = Utils.debounce(this.snapshot.bind(this), 250);

var handle_datachanged = Utils.debounce((function(side, idx){
var sendEmit = false;
@@ -552,6 +551,9 @@ export default class NESBank extends ISurface{


snapshot(){
if (this.__redos.length > 0) // Remove the redo history. We're adding a new snapshot.
this.__redos = [];

var snap = this.base64;
if (this.__undos.length === this.__historyLength){
this.__undos.pop();

Cargando…
Cancelar
Guardar