@krainovsd/graph 0.14.0-beta.6 → 0.14.0-beta.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/lib/cjs/index.cjs +6 -1
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-area.js +1 -0
- package/lib/esm/module/GraphCanvas/slices/init-area.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-resize.js +5 -1
- package/lib/esm/module/GraphCanvas/slices/init-resize.js.map +1 -1
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -1322,6 +1322,7 @@ function initArea() {
|
|
|
1322
1322
|
if (!this.context)
|
|
1323
1323
|
throw new Error("couldn't create canvas context");
|
|
1324
1324
|
this.context.scale(this.dpi, this.dpi);
|
|
1325
|
+
this.updateRect();
|
|
1325
1326
|
}
|
|
1326
1327
|
}
|
|
1327
1328
|
|
|
@@ -2327,8 +2328,12 @@ function initResize() {
|
|
|
2327
2328
|
signal: abortController.signal,
|
|
2328
2329
|
});
|
|
2329
2330
|
document.addEventListener("visibilitychange", () => {
|
|
2330
|
-
if (
|
|
2331
|
+
if (document.hidden)
|
|
2332
|
+
return;
|
|
2333
|
+
this.updateSize();
|
|
2334
|
+
requestAnimationFrame(() => {
|
|
2331
2335
|
this.updateSize();
|
|
2336
|
+
});
|
|
2332
2337
|
}, { signal: abortController.signal });
|
|
2333
2338
|
observer.observe(this.area);
|
|
2334
2339
|
}
|