Remove width trick to use clear rect, fix #280

2.11.x
Francisco López 8 years ago
parent e68e7d3d37
commit b9442034ef

@ -57,7 +57,7 @@ var Filters = require('./torque_filters');
this.TILE_SIZE = 256;
this._style = null;
this._gradients = {};
this._forcePoints = false;
}
@ -68,7 +68,10 @@ var Filters = require('./torque_filters');
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);
@ -165,7 +168,7 @@ var Filters = require('./torque_filters');
i.src = canvas.toDataURL();
return i;
}
return canvas;
},
@ -193,7 +196,7 @@ var Filters = require('./torque_filters');
}
}
}
prof.end(true);
return callback && callback(null);
@ -237,7 +240,7 @@ var Filters = require('./torque_filters');
},
//
// renders a tile in the canvas for key defined in
// renders a tile in the canvas for key defined in
// the torque tile
//
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
@ -274,7 +277,7 @@ var Filters = require('./torque_filters');
}
}
}
prof.end(true);
},
@ -425,7 +428,7 @@ var Filters = require('./torque_filters');
}
gradient = {};
var colorize = this._style['image-filters'].args;
var increment = 1/colorize.length;
for (var i = 0; i < colorize.length; i++){
var key = increment * i + increment;

Loading…
Cancel
Save