Add pixel ratio to label cache key
This commit is contained in:
@@ -281,7 +281,7 @@ ol.render.canvas.TextReplay.prototype.drawText = function(geometry, feature) {
|
||||
*/
|
||||
ol.render.canvas.TextReplay.prototype.getImage = function(text, textKey, fillKey, strokeKey) {
|
||||
var label;
|
||||
var key = strokeKey + textKey + text + fillKey;
|
||||
var key = strokeKey + textKey + text + fillKey + this.pixelRatio;
|
||||
|
||||
var labelCache = ol.render.canvas.labelCache;
|
||||
if (!labelCache.containsKey(key)) {
|
||||
|
||||
@@ -163,7 +163,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
it('renders correct stroke with pixelRatio != 1', function(done) {
|
||||
createMap('canvas', 2);
|
||||
createFeatures();
|
||||
expectResemble(map, 'rendering/ol/style/expected/text-canvas-hidpi.png', 2.8, done);
|
||||
expectResemble(map, 'rendering/ol/style/expected/text-canvas-hidpi.png', 2.9, done);
|
||||
});
|
||||
|
||||
it('renders text correctly with scale != 1', function(done) {
|
||||
|
||||
Reference in New Issue
Block a user