From 79c48b5521c81f41896c8658f8110e78ab0dbbf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 8 Feb 2017 10:27:51 +0100 Subject: [PATCH] Remove width trick to use clear rect, fix #280 --- lib/torque/renderer/point.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/torque/renderer/point.js b/lib/torque/renderer/point.js index 35e827e..2a99b0d 100644 --- a/lib/torque/renderer/point.js +++ b/lib/torque/renderer/point.js @@ -89,7 +89,10 @@ var CartoDatasource = require('./datasource'); var color = this._Map['-torque-clear-color'] // shortcut for the default value if (color === "rgba(255, 255, 255, 0)" || !color) { - this._canvas.width = this._canvas.width; + this._ctx.save(); + this._ctx.setTransform(1, 0, 0, 1, 0, 0); + this._ctx.clearRect(0, 0, canvas.width, canvas.height); + this._ctx.restore(); } else { var ctx = this._ctx; ctx.setTransform(1, 0, 0, 1, 0, 0);