full invalidation only on animation end
This commit is contained in:
parent
deacb1ae00
commit
3f9a8f4a18
@ -60,6 +60,8 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
this.setDuration = this.animator.duration.bind(this.animator);
|
||||
this.isRunning = this.animator.isRunning.bind(this.animator);
|
||||
|
||||
this.lastStep = 0;
|
||||
|
||||
|
||||
L.CanvasLayer.prototype.initialize.call(this, options);
|
||||
|
||||
@ -211,6 +213,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
this.renderer.clearCanvas();
|
||||
var ctx = canvas.getContext('2d');
|
||||
var brrr = false;
|
||||
|
||||
|
||||
for(t in this._tiles) {
|
||||
tile = this._tiles[t];
|
||||
@ -234,7 +237,9 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!brrr) this.renderer.flush();
|
||||
var full = this.getStep() < this.lastStep;
|
||||
this.lastStep = this.getStep();
|
||||
if(!brrr) this.renderer.flush(full);
|
||||
//this.renderer.applyFilters();
|
||||
|
||||
// prepare caches if the animation is not running
|
||||
|
@ -396,13 +396,13 @@ var ballRenderer = require('./ball.js');
|
||||
}
|
||||
}
|
||||
},
|
||||
flush: function(){
|
||||
flush: function(full){
|
||||
this._ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
if(!this.ballRenderer) return;
|
||||
this.ballRenderer.contour(8);
|
||||
this.ballRenderer.isopleth();
|
||||
// this.ballRenderer.contour(4);
|
||||
// this.ballRenderer.isopleth();
|
||||
this.ballRenderer.draw();
|
||||
this.ballRenderer.invalidate();
|
||||
this.ballRenderer.invalidate(full);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user