@flowgram.ai/renderer 0.1.24 → 0.1.25

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.d.mts CHANGED
@@ -129,6 +129,7 @@ declare class FlowNodesTransformLayer extends Layer<FlowNodesTransformLayerOptio
129
129
  onZoom(scale: number): void;
130
130
  dispose(): void;
131
131
  protected renderCache: _flowgram_ai_utils.CacheManager<TransformRenderCache, FlowNodeTransformData>;
132
+ private isCoordEqual;
132
133
  onReady(): void;
133
134
  get visibeBounds(): _flowgram_ai_utils.Rectangle[];
134
135
  /**
package/dist/index.d.ts CHANGED
@@ -129,6 +129,7 @@ declare class FlowNodesTransformLayer extends Layer<FlowNodesTransformLayerOptio
129
129
  onZoom(scale: number): void;
130
130
  dispose(): void;
131
131
  protected renderCache: _flowgram_ai_utils.CacheManager<TransformRenderCache, FlowNodeTransformData>;
132
+ private isCoordEqual;
132
133
  onReady(): void;
133
134
  get visibeBounds(): _flowgram_ai_utils.Rectangle[];
134
135
  /**
package/dist/index.js CHANGED
@@ -759,7 +759,9 @@ var FlowNodesTransformLayer = class extends import_core5.Layer {
759
759
  dispose,
760
760
  updateBounds: () => {
761
761
  const { bounds } = transform;
762
- if (node.style.left !== `${bounds.x}px` || node.style.top !== `${bounds.y}px`) {
762
+ const rawX = parseFloat(node.style.left);
763
+ const rawY = parseFloat(node.style.top);
764
+ if (!this.isCoordEqual(rawX, bounds.x) || !this.isCoordEqual(rawY, bounds.y)) {
763
765
  node.style.left = `${bounds.x}px`;
764
766
  node.style.top = `${bounds.y}px`;
765
767
  }
@@ -782,6 +784,10 @@ var FlowNodesTransformLayer = class extends import_core5.Layer {
782
784
  this.renderCache.dispose();
783
785
  super.dispose();
784
786
  }
787
+ isCoordEqual(a, b) {
788
+ const browserCoordEpsilon = 0.05;
789
+ return Math.abs(a - b) < browserCoordEpsilon;
790
+ }
785
791
  onReady() {
786
792
  this.node.style.zIndex = "10";
787
793
  }