Unused transforms
This commit is contained in:
@@ -6,7 +6,7 @@ import ViewHint from '../../ViewHint.js';
|
|||||||
import {containsExtent, intersects} from '../../extent.js';
|
import {containsExtent, intersects} from '../../extent.js';
|
||||||
import {getIntersection, isEmpty} from '../../extent.js';
|
import {getIntersection, isEmpty} from '../../extent.js';
|
||||||
import CanvasLayerRenderer from './Layer.js';
|
import CanvasLayerRenderer from './Layer.js';
|
||||||
import {create as createTransform, compose as composeTransform, toString as transformToString} from '../../transform.js';
|
import {compose as composeTransform, toString as transformToString} from '../../transform.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -21,12 +21,6 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|||||||
constructor(imageLayer) {
|
constructor(imageLayer) {
|
||||||
super(imageLayer);
|
super(imageLayer);
|
||||||
|
|
||||||
/**
|
|
||||||
* @protected
|
|
||||||
* @type {import("../../transform.js").Transform}
|
|
||||||
*/
|
|
||||||
this.coordinateToCanvasPixelTransform = createTransform();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {?import("../../ImageBase.js").default}
|
* @type {?import("../../ImageBase.js").default}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import TileRange from '../../TileRange.js';
|
|||||||
import TileState from '../../TileState.js';
|
import TileState from '../../TileState.js';
|
||||||
import {createEmpty, getIntersection, getTopLeft} from '../../extent.js';
|
import {createEmpty, getIntersection, getTopLeft} from '../../extent.js';
|
||||||
import CanvasLayerRenderer from './Layer.js';
|
import CanvasLayerRenderer from './Layer.js';
|
||||||
import {create as createTransform, compose as composeTransform, toString as transformToString} from '../../transform.js';
|
import {compose as composeTransform, toString as transformToString} from '../../transform.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -21,12 +21,6 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
constructor(tileLayer) {
|
constructor(tileLayer) {
|
||||||
super(tileLayer);
|
super(tileLayer);
|
||||||
|
|
||||||
/**
|
|
||||||
* @protected
|
|
||||||
* @type {import("../../transform.js").Transform}
|
|
||||||
*/
|
|
||||||
this.coordinateToCanvasPixelTransform = createTransform();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {equals} from '../../array.js';
|
|||||||
import {getHeight, getWidth, isEmpty} from '../../extent.js';
|
import {getHeight, getWidth, isEmpty} from '../../extent.js';
|
||||||
import {assign} from '../../obj.js';
|
import {assign} from '../../obj.js';
|
||||||
import CanvasImageLayerRenderer from './ImageLayer.js';
|
import CanvasImageLayerRenderer from './ImageLayer.js';
|
||||||
import {compose as composeTransform} from '../../transform.js';
|
|
||||||
import CanvasVectorLayerRenderer from './VectorLayer.js';
|
import CanvasVectorLayerRenderer from './VectorLayer.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,9 +48,7 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
|||||||
*/
|
*/
|
||||||
prepareFrame(frameState, layerState) {
|
prepareFrame(frameState, layerState) {
|
||||||
const pixelRatio = frameState.pixelRatio;
|
const pixelRatio = frameState.pixelRatio;
|
||||||
const size = frameState.size;
|
|
||||||
const viewState = frameState.viewState;
|
const viewState = frameState.viewState;
|
||||||
const viewCenter = viewState.center;
|
|
||||||
const viewResolution = viewState.resolution;
|
const viewResolution = viewState.resolution;
|
||||||
|
|
||||||
const hints = frameState.viewHints;
|
const hints = frameState.viewHints;
|
||||||
@@ -90,25 +87,8 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
|||||||
|
|
||||||
if (this.image_) {
|
if (this.image_) {
|
||||||
const image = this.image_;
|
const image = this.image_;
|
||||||
const imageExtent = image.getExtent();
|
|
||||||
const imageResolution = image.getResolution();
|
const imageResolution = image.getResolution();
|
||||||
const imagePixelRatio = image.getPixelRatio();
|
const imagePixelRatio = image.getPixelRatio();
|
||||||
const scale = pixelRatio * imageResolution /
|
|
||||||
(viewResolution * imagePixelRatio);
|
|
||||||
|
|
||||||
const transform = composeTransform(this.transform_,
|
|
||||||
pixelRatio * size[0] / 2, pixelRatio * size[1] / 2,
|
|
||||||
scale, scale,
|
|
||||||
0,
|
|
||||||
imagePixelRatio * (imageExtent[0] - viewCenter[0]) / imageResolution,
|
|
||||||
imagePixelRatio * (viewCenter[1] - imageExtent[3]) / imageResolution);
|
|
||||||
|
|
||||||
composeTransform(this.coordinateToCanvasPixelTransform,
|
|
||||||
pixelRatio * size[0] / 2 - transform[4], pixelRatio * size[1] / 2 - transform[5],
|
|
||||||
pixelRatio / viewResolution, -pixelRatio / viewResolution,
|
|
||||||
0,
|
|
||||||
-viewCenter[0], -viewCenter[1]);
|
|
||||||
|
|
||||||
this.renderedResolution = imageResolution * pixelRatio / imagePixelRatio;
|
this.renderedResolution = imageResolution * pixelRatio / imagePixelRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user