Commit 46f097c5 authored by Martín's avatar Martín
Browse files

Fix en overlap de animaciones

parent 83f8a607
......@@ -51,7 +51,7 @@ export class CanvasComponent {
//Todo, abscisa y ordenada
tipoZoom = "Todo";
tipoZoomDesc = "Zoom en ambos ejes";
timeOutRef:number;
@ViewChild('canvasElement') canvasRef: ElementRef;
......@@ -161,7 +161,8 @@ export class CanvasComponent {
}
public limpiarCanvas = function(){
this.animar_ = false;
this.animar_ = false;
clearTimeout(this.timeOutRef);
this.objetos = [];
this.context.clearRect(0, 0, this.canvasRef.nativeElement.width, this.canvasRef.nativeElement.height);
if(this.mostrarEjes || this.mostrarGrilla){
......@@ -307,7 +308,7 @@ private animar = function(){
this.objetos = this.elementosAnimacion[this.frameAnimacion];
this.dibujarObjetos();
if(this.animando){
setTimeout(function(){
this.timeOutRef = setTimeout(function(){
if(this.animando){
this.frameAnimacion ++;
if(this.frameAnimacion>=this.elementosAnimacion.length){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment