Set pixelTransform and inversePixelTransform as protected

The variables are used in child classes
This commit is contained in:
Frederic Junod
2019-06-14 14:52:26 +02:00
parent 92c16ecdf5
commit ec5e8bfa50
4 changed files with 19 additions and 19 deletions

View File

@@ -227,18 +227,18 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
const canvasScale = tileResolution / viewResolution;
// set forward and inverse pixel transforms
composeTransform(this.pixelTransform_,
composeTransform(this.pixelTransform,
frameState.size[0] / 2, frameState.size[1] / 2,
1 / tilePixelRatio, 1 / tilePixelRatio,
rotation,
-width / 2, -height / 2
);
this.useContainer(target, this.pixelTransform_, layerState.opacity);
this.useContainer(target, this.pixelTransform, layerState.opacity);
const context = this.context;
const canvas = context.canvas;
makeInverse(this.inversePixelTransform_, this.pixelTransform_);
makeInverse(this.inversePixelTransform, this.pixelTransform);
// set scale transform for calculating tile positions on the canvas
composeTransform(this.tempTransform_,
@@ -361,7 +361,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
context.restore();
}
const canvasTransform = transformToString(this.pixelTransform_);
const canvasTransform = transformToString(this.pixelTransform);
if (canvasTransform !== canvas.style.transform) {
canvas.style.transform = canvasTransform;
}