@fieldnotes/core 0.50.6 → 0.50.7

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/dist/index.cjs CHANGED
@@ -6502,7 +6502,7 @@ var RenderLoop = class {
6502
6502
  layerGroups = /* @__PURE__ */ new Map();
6503
6503
  gridCacheCanvas = null;
6504
6504
  gridCacheCtx = null;
6505
- lastGridRef = null;
6505
+ lastGridRefs = [];
6506
6506
  constructor(deps) {
6507
6507
  this.canvasEl = deps.canvasEl;
6508
6508
  this.camera = deps.camera;
@@ -6702,8 +6702,8 @@ var RenderLoop = class {
6702
6702
  }
6703
6703
  if (gridElements.length > 0) {
6704
6704
  const gridT0 = performance.now();
6705
- const gridRef = gridElements[0];
6706
- const gridDirty = this.gridCacheDirty || gridRef !== this.lastGridRef;
6705
+ const gridsChanged = gridElements.length !== this.lastGridRefs.length || gridElements.some((grid, index) => grid !== this.lastGridRefs[index]);
6706
+ const gridDirty = this.gridCacheDirty || gridsChanged;
6707
6707
  if (gridDirty) {
6708
6708
  this.ensureGridCache();
6709
6709
  if (this.gridCacheCtx && this.gridCacheCanvas) {
@@ -6731,7 +6731,7 @@ var RenderLoop = class {
6731
6731
  }
6732
6732
  }
6733
6733
  this.gridCacheDirty = false;
6734
- this.lastGridRef = gridRef;
6734
+ this.lastGridRefs = [...gridElements];
6735
6735
  }
6736
6736
  if (this.gridCacheCanvas) {
6737
6737
  const offset = this.marginViewport.compositeOffset(
@@ -6751,6 +6751,8 @@ var RenderLoop = class {
6751
6751
  }
6752
6752
  }
6753
6753
  gridMs = performance.now() - gridT0;
6754
+ } else {
6755
+ this.lastGridRefs = [];
6754
6756
  }
6755
6757
  const overlayT0 = performance.now();
6756
6758
  const activeTool = this.toolManager.activeTool;
@@ -10724,7 +10726,7 @@ var LaserTool = class {
10724
10726
  };
10725
10727
 
10726
10728
  // src/index.ts
10727
- var VERSION = "0.50.6";
10729
+ var VERSION = "0.50.7";
10728
10730
  // Annotate the CommonJS export names for ESM import in node:
10729
10731
  0 && (module.exports = {
10730
10732
  ArrowTool,