Scale WebGL output canvas by devicePixelRatio
This commit is contained in:
committed by
Tom Payne
parent
2ccec58878
commit
a139814b2f
@@ -473,10 +473,11 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
|
|||||||
layerRenderer.prepareFrame(frameState, layerState);
|
layerRenderer.prepareFrame(frameState, layerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
var size = frameState.size;
|
var width = frameState.size[0] * frameState.pixelRatio;
|
||||||
if (this.canvas_.width != size[0] || this.canvas_.height != size[1]) {
|
var height = frameState.size[1] * frameState.pixelRatio;
|
||||||
this.canvas_.width = size[0];
|
if (this.canvas_.width != width || this.canvas_.height != height) {
|
||||||
this.canvas_.height = size[1];
|
this.canvas_.width = width;
|
||||||
|
this.canvas_.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.bindFramebuffer(goog.webgl.FRAMEBUFFER, null);
|
gl.bindFramebuffer(goog.webgl.FRAMEBUFFER, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user