geojs 1.10.2 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geojs",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "description": "JavaScript Geo Visualization and Analysis Library",
5
5
  "homepage": "https://github.com/OpenGeoscience/geojs",
6
6
  "license": "Apache-2.0",
@@ -373,7 +373,19 @@ var webgl_quadFeature = function (arg) {
373
373
  }
374
374
  m_quads.imgQuads.forEach((quad) => {
375
375
  if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel) {
376
+ /* This could just be
377
+ * quad.texture.setNearestPixel(nearestPixel);
378
+ * but that needlessly redecodes the image. Instead, just change the
379
+ * the interpolation flags, then change the nearestPixel value
380
+ * without triggering a complete re-setup. */
381
+ renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, quad.texture.textureHandle());
382
+ renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MIN_FILTER, nearestPixel ? vgl.GL.NEAREST : vgl.GL.LINEAR);
383
+ renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MAG_FILTER, nearestPixel ? vgl.GL.NEAREST : vgl.GL.LINEAR);
384
+ renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, null);
385
+ const oldmod = quad.texture.modified;
386
+ quad.texture.modified = () => {};
376
387
  quad.texture.setNearestPixel(nearestPixel);
388
+ quad.texture.modified = oldmod;
377
389
  }
378
390
  });
379
391
  }