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

@@ -44,18 +44,18 @@ class CanvasLayerRenderer extends LayerRenderer {
/**
* The transform for rendered pixels to viewport CSS pixels. This transform must
* be set when rendering a frame and may be used by other functions after rendering.
* @private
* @protected
* @type {import("../../transform.js").Transform}
*/
this.pixelTransform_ = createTransform();
this.pixelTransform = createTransform();
/**
* The transform for viewport CSS pixels to rendered pixels. This transform must
* be set when rendering a frame and may be used by other functions after rendering.
* @private
* @protected
* @type {import("../../transform.js").Transform}
*/
this.inversePixelTransform_ = createTransform();
this.inversePixelTransform = createTransform();
/**
* @protected
@@ -163,7 +163,7 @@ class CanvasLayerRenderer extends LayerRenderer {
applyTransform(frameState.coordinateToPixelTransform, bottomRight);
applyTransform(frameState.coordinateToPixelTransform, bottomLeft);
const inverted = this.inversePixelTransform_;
const inverted = this.inversePixelTransform;
applyTransform(inverted, topLeft);
applyTransform(inverted, topRight);
applyTransform(inverted, bottomRight);
@@ -187,7 +187,7 @@ class CanvasLayerRenderer extends LayerRenderer {
dispatchRenderEvent_(type, context, frameState) {
const layer = this.getLayer();
if (layer.hasListener(type)) {
const event = new RenderEvent(type, this.inversePixelTransform_, frameState, context, null);
const event = new RenderEvent(type, this.inversePixelTransform, frameState, context, null);
layer.dispatchEvent(event);
}
}
@@ -240,7 +240,7 @@ class CanvasLayerRenderer extends LayerRenderer {
* returned, and empty array will be returned.
*/
getDataAtPixel(pixel, frameState, hitTolerance) {
const renderPixel = applyTransform(this.inversePixelTransform_, pixel.slice());
const renderPixel = applyTransform(this.inversePixelTransform, pixel.slice());
const context = this.context;
let data;