@canvas-harness/core 0.1.21 → 0.1.23

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.js CHANGED
@@ -4775,10 +4775,12 @@ var cacheReuseLayout = (cache5, view) => {
4775
4775
  const cacheW = cache5.widthDevicePx;
4776
4776
  const cacheH = cache5.heightDevicePx;
4777
4777
  const marginDev = cache5.marginCssPx * cache5.dpr;
4778
- const destW = cacheW * ratio;
4779
- const destH = cacheH * ratio;
4780
- const destX = (cache5.camX - view.camX) * view.camZ * cache5.dpr + marginDev * (1 - ratio);
4781
- const destY = (cache5.camY - view.camY) * view.camZ * cache5.dpr + marginDev * (1 - ratio);
4778
+ const rawDestX = (cache5.camX - view.camX) * view.camZ * cache5.dpr + marginDev * (1 - ratio);
4779
+ const rawDestY = (cache5.camY - view.camY) * view.camZ * cache5.dpr + marginDev * (1 - ratio);
4780
+ const destX = Math.round(rawDestX);
4781
+ const destY = Math.round(rawDestY);
4782
+ const destW = Math.round(rawDestX + cacheW * ratio) - destX;
4783
+ const destH = Math.round(rawDestY + cacheH * ratio) - destY;
4782
4784
  const dest = { x: destX, y: destY, w: destW, h: destH };
4783
4785
  const strips = {
4784
4786
  top: { x: 0, y: 0, w: cacheW, h: Math.max(0, destY) },
@@ -4947,6 +4949,8 @@ var createRenderer = (opts) => {
4947
4949
  paintBackground(surface.ctx, { viewport, zoom: camera.z, background });
4948
4950
  const visible = visibleNodes(camera, viewport);
4949
4951
  const isMoving2 = isMoving(interaction);
4952
+ const viewMotion = interaction.mode === "panning" || interaction.mode === "zooming" || interaction.mode === "marqueeing";
4953
+ const isStripRender = !fullRender;
4950
4954
  const minOnScreen = MIN_ON_SCREEN_SIZE_PX;
4951
4955
  const nextOverlaySet = /* @__PURE__ */ new Set();
4952
4956
  let drawn = 0;
@@ -5035,7 +5039,7 @@ var createRenderer = (opts) => {
5035
5039
  if (!def) continue;
5036
5040
  if (node.w * camera.z < minOnScreen && node.h * camera.z < minOnScreen) continue;
5037
5041
  if (camera.z < def.lod.minZoomForPlaceholder) continue;
5038
- const preferCanvas = camera.z < def.lod.minZoomForReact || isMoving2;
5042
+ const preferCanvas = camera.z < def.lod.minZoomForReact || viewMotion && isStripRender && !overlaySet.has(node.id);
5039
5043
  if (preferCanvas) {
5040
5044
  if (paintCustomCanvasFallback(surface.ctx, node, def, scale, renderEnv)) {
5041
5045
  drawn++;