@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/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/esm/index.js
CHANGED
|
@@ -719,7 +719,9 @@ var FlowNodesTransformLayer = class extends Layer {
|
|
|
719
719
|
dispose,
|
|
720
720
|
updateBounds: () => {
|
|
721
721
|
const { bounds } = transform;
|
|
722
|
-
|
|
722
|
+
const rawX = parseFloat(node.style.left);
|
|
723
|
+
const rawY = parseFloat(node.style.top);
|
|
724
|
+
if (!this.isCoordEqual(rawX, bounds.x) || !this.isCoordEqual(rawY, bounds.y)) {
|
|
723
725
|
node.style.left = `${bounds.x}px`;
|
|
724
726
|
node.style.top = `${bounds.y}px`;
|
|
725
727
|
}
|
|
@@ -742,6 +744,10 @@ var FlowNodesTransformLayer = class extends Layer {
|
|
|
742
744
|
this.renderCache.dispose();
|
|
743
745
|
super.dispose();
|
|
744
746
|
}
|
|
747
|
+
isCoordEqual(a, b) {
|
|
748
|
+
const browserCoordEpsilon = 0.05;
|
|
749
|
+
return Math.abs(a - b) < browserCoordEpsilon;
|
|
750
|
+
}
|
|
745
751
|
onReady() {
|
|
746
752
|
this.node.style.zIndex = "10";
|
|
747
753
|
}
|