Scale output canvas by devicePixelRatio

This commit is contained in:
Frederic Junod
2013-12-12 14:46:39 +01:00
committed by Tom Payne
parent bd1107f785
commit 355c0a1017
4 changed files with 39 additions and 13 deletions

View File

@@ -382,10 +382,12 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame =
this.scheduleExpireCache(frameState, tileSource);
this.updateLogos(frameState, tileSource);
var devicePixelRatio = frameState.devicePixelRatio;
ol.vec.Mat4.makeTransform2D(this.imageTransform_,
frameState.size[0] / 2, frameState.size[1] / 2,
tileResolution / view2DState.resolution,
tileResolution / view2DState.resolution,
devicePixelRatio * frameState.size[0] / 2,
devicePixelRatio * frameState.size[1] / 2,
devicePixelRatio * tileResolution / view2DState.resolution,
devicePixelRatio * tileResolution / view2DState.resolution,
view2DState.rotation,
(origin[0] - center[0]) / tileResolution,
(center[1] - origin[1]) / tileResolution);