@fieldnotes/core 0.52.1 → 0.52.2
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/README.md +705 -705
- package/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -983,6 +983,12 @@ function getElementBounds(element) {
|
|
|
983
983
|
}
|
|
984
984
|
return null;
|
|
985
985
|
}
|
|
986
|
+
function getElementVisualBounds(element) {
|
|
987
|
+
const bounds = getElementBounds(element);
|
|
988
|
+
if (!bounds) return null;
|
|
989
|
+
const rotation = element.rotation ?? 0;
|
|
990
|
+
return rotation === 0 ? bounds : rotatedAABB(bounds, rotation);
|
|
991
|
+
}
|
|
986
992
|
function getArrowBoundsAnalytical(from, to, bend) {
|
|
987
993
|
if (bend === 0) {
|
|
988
994
|
const minX2 = Math.min(from.x, to.x);
|
|
@@ -2754,10 +2760,7 @@ var ElementStore = class {
|
|
|
2754
2760
|
// Spatial index stores the rotation-expanded AABB so rotated elements remain
|
|
2755
2761
|
// broad-phase hit-test/marquee candidates; precise tests run against local bounds.
|
|
2756
2762
|
indexBounds(element) {
|
|
2757
|
-
|
|
2758
|
-
if (!bounds) return null;
|
|
2759
|
-
const angle = element.rotation ?? 0;
|
|
2760
|
-
return angle === 0 ? bounds : rotatedAABB(bounds, angle);
|
|
2763
|
+
return getElementVisualBounds(element);
|
|
2761
2764
|
}
|
|
2762
2765
|
add(element, meta) {
|
|
2763
2766
|
element = sanitizeRichText(element);
|
|
@@ -7078,7 +7081,7 @@ var RenderLoop = class {
|
|
|
7078
7081
|
if (this.renderer.isDomElement(element)) {
|
|
7079
7082
|
activeHybridOrder = null;
|
|
7080
7083
|
const layerOpacity = this.layerManager.getLayer?.(element.layerId)?.opacity ?? 1;
|
|
7081
|
-
const elBounds =
|
|
7084
|
+
const elBounds = getElementVisualBounds(element);
|
|
7082
7085
|
if (elBounds && !boundsIntersect(elBounds, cullingRect)) {
|
|
7083
7086
|
this.domNodeManager.hideDomNode(element.id);
|
|
7084
7087
|
} else {
|
|
@@ -7135,7 +7138,7 @@ var RenderLoop = class {
|
|
|
7135
7138
|
offCtx.save();
|
|
7136
7139
|
this.marginViewport.applyRenderTransform(offCtx);
|
|
7137
7140
|
for (const element of elements) {
|
|
7138
|
-
const elBounds =
|
|
7141
|
+
const elBounds = getElementVisualBounds(element);
|
|
7139
7142
|
if (elBounds && !boundsIntersect(elBounds, cullingRect)) continue;
|
|
7140
7143
|
this.renderer.renderCanvasElement(offCtx, element);
|
|
7141
7144
|
}
|
|
@@ -7210,7 +7213,7 @@ var RenderLoop = class {
|
|
|
7210
7213
|
hybridCtx.translate(this.camera.position.x, this.camera.position.y);
|
|
7211
7214
|
hybridCtx.scale(this.camera.zoom, this.camera.zoom);
|
|
7212
7215
|
for (const element of elements) {
|
|
7213
|
-
const elBounds =
|
|
7216
|
+
const elBounds = getElementVisualBounds(element);
|
|
7214
7217
|
if (elBounds && !boundsIntersect(elBounds, cullingRect)) continue;
|
|
7215
7218
|
hybridCtx.save();
|
|
7216
7219
|
hybridCtx.globalAlpha = this.layerManager.getLayer?.(element.layerId)?.opacity ?? 1;
|
|
@@ -11209,7 +11212,7 @@ var LaserTool = class {
|
|
|
11209
11212
|
};
|
|
11210
11213
|
|
|
11211
11214
|
// src/index.ts
|
|
11212
|
-
var VERSION = "0.52.
|
|
11215
|
+
var VERSION = "0.52.2";
|
|
11213
11216
|
// Annotate the CommonJS export names for ESM import in node:
|
|
11214
11217
|
0 && (module.exports = {
|
|
11215
11218
|
ArrowTool,
|