@canvas-harness/core 0.1.14 → 0.1.16

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.cts CHANGED
@@ -1519,7 +1519,15 @@ type EditTarget = {
1519
1519
  };
1520
1520
  declare const idleInteractionState: () => InteractionState;
1521
1521
  /**
1522
- * Convenience: any of panning/zooming/dragging/resizing/rotating is "moving".
1522
+ * Convenience: any pointer-driven, per-frame-invalidating gesture is
1523
+ * "moving". Drives LOD swaps in the renderer (custom-node React→canvas
1524
+ * fallback, text bitmap downscale, edge-label bitmap downscale).
1525
+ *
1526
+ * `marqueeing` belongs here even though the scene doesn't translate:
1527
+ * the marquee rect updates every pointermove → static cache invalidates
1528
+ * → full repaint per frame. Without the swap, dense scenes paint
1529
+ * full-LOD React overlays + full-res text bitmaps under the moving
1530
+ * rect and the gesture janks.
1523
1531
  */
1524
1532
  declare const isMoving: (state: InteractionState) => boolean;
1525
1533
 
package/dist/index.d.ts CHANGED
@@ -1519,7 +1519,15 @@ type EditTarget = {
1519
1519
  };
1520
1520
  declare const idleInteractionState: () => InteractionState;
1521
1521
  /**
1522
- * Convenience: any of panning/zooming/dragging/resizing/rotating is "moving".
1522
+ * Convenience: any pointer-driven, per-frame-invalidating gesture is
1523
+ * "moving". Drives LOD swaps in the renderer (custom-node React→canvas
1524
+ * fallback, text bitmap downscale, edge-label bitmap downscale).
1525
+ *
1526
+ * `marqueeing` belongs here even though the scene doesn't translate:
1527
+ * the marquee rect updates every pointermove → static cache invalidates
1528
+ * → full repaint per frame. Without the swap, dense scenes paint
1529
+ * full-LOD React overlays + full-res text bitmaps under the moving
1530
+ * rect and the gesture janks.
1523
1531
  */
1524
1532
  declare const isMoving: (state: InteractionState) => boolean;
1525
1533
 
package/dist/index.js CHANGED
@@ -2593,7 +2593,7 @@ var idleInteractionState = () => ({
2593
2593
  });
2594
2594
  var isMoving = (state) => {
2595
2595
  const m = state.mode;
2596
- return m === "panning" || m === "zooming" || m === "dragging" || m === "resizing" || m === "rotating";
2596
+ return m === "panning" || m === "zooming" || m === "dragging" || m === "resizing" || m === "rotating" || m === "marqueeing";
2597
2597
  };
2598
2598
 
2599
2599
  // src/store/inverse-op.ts
@@ -4342,8 +4342,10 @@ var drawAtomic = (ctx, type, w, h, style, scale, theme, opts) => {
4342
4342
  if (strokeVisible && !opts?.skipStroke) {
4343
4343
  ctx.strokeStyle = stroke;
4344
4344
  ctx.lineWidth = Math.max(strokeWidth, 1 / scale);
4345
- ctx.setLineDash(dashPatternFor(style?.strokeStyle, strokeWidth));
4345
+ const dash = dashPatternFor(style?.strokeStyle, strokeWidth);
4346
+ ctx.setLineDash(dash);
4346
4347
  ctx.stroke();
4348
+ if (dash.length > 0) ctx.setLineDash([]);
4347
4349
  }
4348
4350
  if (needsScope) ctx.restore();
4349
4351
  };
@@ -4901,7 +4903,7 @@ var createRenderer = (opts) => {
4901
4903
  const excludedEdges = midpointEdgeId !== null ? /* @__PURE__ */ new Set([...baseExcludedEdges ?? [], midpointEdgeId]) : baseExcludedEdges;
4902
4904
  paintBackground(surface.ctx, { viewport, zoom: camera.z, background });
4903
4905
  const visible = visibleNodes(camera, viewport);
4904
- const isMoving2 = interaction.mode === "panning" || interaction.mode === "zooming" || interaction.mode === "dragging" || interaction.mode === "resizing" || interaction.mode === "rotating";
4906
+ const isMoving2 = isMoving(interaction);
4905
4907
  const minOnScreen = MIN_ON_SCREEN_SIZE_PX;
4906
4908
  const nextOverlaySet = /* @__PURE__ */ new Set();
4907
4909
  let drawn = 0;