Revert "Merge pull request #4344 from bartvde/issue-2844"

This reverts commit e5c44b37c9, reversing
changes made to 7f4c6e3634.
This commit is contained in:
Andreas Hocevar
2015-11-12 19:17:07 +01:00
parent bb5377fb8c
commit c5f4710b8d
13 changed files with 31 additions and 75 deletions
+7 -9
View File
@@ -93,7 +93,7 @@ ol.reproj.enlargeClipPoint_ = function(centroidX, centroidY, x, y) {
* @param {number} width Width of the canvas.
* @param {number} height Height of the canvas.
* @param {number} pixelRatio Pixel ratio.
* @param {Array.<number>} sourceResolution Source resolution.
* @param {number} sourceResolution Source resolution.
* @param {ol.Extent} sourceExtent Extent of the data source.
* @param {number} targetResolution Target resolution.
* @param {ol.Extent} targetExtent Target extent.
@@ -124,14 +124,12 @@ ol.reproj.render = function(width, height, pixelRatio,
var canvasWidthInUnits = ol.extent.getWidth(sourceDataExtent);
var canvasHeightInUnits = ol.extent.getHeight(sourceDataExtent);
var sourceResolutionX = sourceResolution[0];
var sourceResolutionY = sourceResolution[1];
var stitchContext = ol.dom.createCanvasContext2D(
Math.round(pixelRatio * canvasWidthInUnits / sourceResolutionX),
Math.round(pixelRatio * canvasHeightInUnits / sourceResolutionY));
Math.round(pixelRatio * canvasWidthInUnits / sourceResolution),
Math.round(pixelRatio * canvasHeightInUnits / sourceResolution));
stitchContext.scale(pixelRatio / sourceResolutionX,
pixelRatio / sourceResolutionY);
stitchContext.scale(pixelRatio / sourceResolution,
pixelRatio / sourceResolution);
stitchContext.translate(-sourceDataExtent[0], sourceDataExtent[3]);
sources.forEach(function(src, i, arr) {
@@ -224,8 +222,8 @@ ol.reproj.render = function(width, height, pixelRatio,
context.translate(sourceDataExtent[0] - sourceNumericalShiftX,
sourceDataExtent[3] - sourceNumericalShiftY);
context.scale(sourceResolutionX / pixelRatio,
-sourceResolutionY / pixelRatio);
context.scale(sourceResolution / pixelRatio,
-sourceResolution / pixelRatio);
context.drawImage(stitchContext.canvas, 0, 0);
context.restore();