Remove IE image smoothing fallback

This commit is contained in:
Maximilian Krög
2022-07-30 22:36:32 +02:00
parent 37aaf8ed4b
commit 6a6d2cd612
5 changed files with 7 additions and 32 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ import CanvasLayerRenderer from './Layer.js';
import ImageState from '../../ImageState.js';
import ViewHint from '../../ViewHint.js';
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
import {IMAGE_SMOOTHING_DISABLED, IMAGE_SMOOTHING_ENABLED} from './common.js';
import {
apply as applyTransform,
compose as composeTransform,
@@ -238,7 +237,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
const dh = img.height * transform[3];
if (!this.getLayer().getSource().getInterpolate()) {
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
context.imageSmoothingEnabled = false;
}
this.preRender(context, frameState);
@@ -261,7 +260,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
if (clipped) {
context.restore();
}
Object.assign(context, IMAGE_SMOOTHING_ENABLED);
context.imageSmoothingEnabled = true;
if (canvasTransform !== canvas.style.transform) {
canvas.style.transform = canvasTransform;
+2 -3
View File
@@ -6,7 +6,6 @@ import ImageTile from '../../ImageTile.js';
import ReprojTile from '../../reproj/Tile.js';
import TileRange from '../../TileRange.js';
import TileState from '../../TileState.js';
import {IMAGE_SMOOTHING_DISABLED, IMAGE_SMOOTHING_ENABLED} from './common.js';
import {
apply as applyTransform,
compose as composeTransform,
@@ -410,7 +409,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
}
if (!tileSource.getInterpolate()) {
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
context.imageSmoothingEnabled = false;
}
this.preRender(context, frameState);
@@ -561,7 +560,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
if (layerState.extent) {
context.restore();
}
Object.assign(context, IMAGE_SMOOTHING_ENABLED);
context.imageSmoothingEnabled = true;
if (canvasTransform !== canvas.style.transform) {
canvas.style.transform = canvasTransform;
-21
View File
@@ -1,21 +0,0 @@
/**
* @module ol/renderer/canvas/common
*/
/**
* Context options to disable image smoothing.
* @type {Object}
*/
export const IMAGE_SMOOTHING_DISABLED = {
imageSmoothingEnabled: false,
msImageSmoothingEnabled: false,
};
/**
* Context options to enable image smoothing.
* @type {Object}
*/
export const IMAGE_SMOOTHING_ENABLED = {
imageSmoothingEnabled: true,
msImageSmoothingEnabled: true,
};