Fix layer canvas reuse
If the scale values have more than 6 decimals they are rounded and can no longer be compared to the created transform string.
This commit is contained in:
@@ -7,9 +7,9 @@ import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
||||
import {assign} from '../../obj.js';
|
||||
import {compose as composeTransform, makeInverse} from '../../transform.js';
|
||||
import {containsExtent, intersects} from '../../extent.js';
|
||||
import {createTransformString} from '../../render/canvas.js';
|
||||
import {fromUserExtent} from '../../proj.js';
|
||||
import {getIntersection, isEmpty} from '../../extent.js';
|
||||
import {toString as toTransformString} from '../../transform.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -132,7 +132,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
||||
);
|
||||
makeInverse(this.inversePixelTransform, this.pixelTransform);
|
||||
|
||||
const canvasTransform = createTransformString(this.pixelTransform);
|
||||
const canvasTransform = toTransformString(this.pixelTransform);
|
||||
|
||||
this.useContainer(target, canvasTransform, layerState.opacity);
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ import {
|
||||
getIntersection,
|
||||
getTopLeft,
|
||||
} from '../../extent.js';
|
||||
import {createTransformString} from '../../render/canvas.js';
|
||||
import {fromUserExtent} from '../../proj.js';
|
||||
import {getUid} from '../../util.js';
|
||||
import {numberSafeCompareFunction} from '../../array.js';
|
||||
import {toString as toTransformString} from '../../transform.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -280,7 +280,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
-height / 2
|
||||
);
|
||||
|
||||
const canvasTransform = createTransformString(this.pixelTransform);
|
||||
const canvasTransform = toTransformString(this.pixelTransform);
|
||||
|
||||
this.useContainer(target, canvasTransform, layerState.opacity);
|
||||
const context = this.context;
|
||||
|
||||
Reference in New Issue
Block a user