only redraw after setImageSmoothingEnabled() when changed

This commit is contained in:
Tom 2024-11-14 13:13:13 -05:00
parent 4163a46a24
commit 02805226d4

View File

@ -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();
}
/**