From a53de47f2d36f2cf4bd5832663177f71eda06a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 8 Feb 2017 15:03:45 +0100 Subject: [PATCH] Make a local variable of ctx --- lib/torque/renderer/point.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/torque/renderer/point.js b/lib/torque/renderer/point.js index 3b4fc7a..19ef2c0 100644 --- a/lib/torque/renderer/point.js +++ b/lib/torque/renderer/point.js @@ -67,13 +67,13 @@ var Filters = require('./torque_filters'); var canvas = this._canvas; var color = this._Map['-torque-clear-color'] // shortcut for the default value + var ctx = this._ctx; if (color === "rgba(255, 255, 255, 0)" || !color) { - this._ctx.save(); - this._ctx.setTransform(1, 0, 0, 1, 0, 0); - this._ctx.clearRect(0, 0, canvas.width, canvas.height); - this._ctx.restore(); + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.restore(); } else { - var ctx = this._ctx; ctx.setTransform(1, 0, 0, 1, 0, 0); var compop = this._Map['comp-op'] ctx.globalCompositeOperation = compop2canvas(compop);