From 02805226d46e72370078d26b0861b9403c51ef54 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 14 Nov 2024 13:13:13 -0500 Subject: [PATCH] only redraw after setImageSmoothingEnabled() when changed --- src/webgldrawer.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/webgldrawer.js b/src/webgldrawer.js index bd712f28..fa61afbc 100644 --- a/src/webgldrawer.js +++ b/src/webgldrawer.js @@ -489,14 +489,11 @@ * @param {Boolean} enabled If true, uses gl.LINEAR as the TEXTURE_MIN_FILTER and TEXTURE_MAX_FILTER, otherwise gl.NEAREST. */ setImageSmoothingEnabled(enabled){ - const changed = this._imageSmoothingEnabled !== enabled; - this._imageSmoothingEnabled = enabled; - if( changed ){ - // We need to unload all existing textures so they can be recreated with the new filter + if( this._imageSmoothingEnabled !== enabled ){ + this._imageSmoothingEnabled = enabled; this._unloadTextures(); + this.viewer.world.draw(); } - // trigger a re-draw - this.viewer.world.draw(); } /**