@canvas-harness/core 0.1.17 → 0.1.19

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.cjs CHANGED
@@ -1919,14 +1919,7 @@ var drawEdge = (ctx, edge, geom, sourceNode, targetNode, scale, theme, opts) =>
1919
1919
  ctx.restore();
1920
1920
  if (drawSourceArrow) {
1921
1921
  const tipDir = directionTowardTip(samples, clip.startIndex, clip.startPoint, 1);
1922
- drawArrowhead(
1923
- ctx,
1924
- sourceArrowhead,
1925
- clip.startPoint,
1926
- negateVec(tipDir),
1927
- strokeColor,
1928
- strokeWidth
1929
- );
1922
+ drawArrowhead(ctx, sourceArrowhead, clip.startPoint, tipDir, strokeColor, strokeWidth);
1930
1923
  }
1931
1924
  if (drawTargetArrow) {
1932
1925
  const tipDir = directionTowardTip(samples, clip.endIndex, clip.endPoint, -1);
@@ -1955,14 +1948,7 @@ var drawEdge = (ctx, edge, geom, sourceNode, targetNode, scale, theme, opts) =>
1955
1948
  ctx.restore();
1956
1949
  if (drawSourceArrow) {
1957
1950
  const tipDir = directionTowardTip(samples, clip.startIndex, clip.startPoint, 1);
1958
- drawArrowhead(
1959
- ctx,
1960
- sourceArrowhead,
1961
- clip.startPoint,
1962
- negateVec(tipDir),
1963
- strokeColor,
1964
- strokeWidth
1965
- );
1951
+ drawArrowhead(ctx, sourceArrowhead, clip.startPoint, tipDir, strokeColor, strokeWidth);
1966
1952
  }
1967
1953
  if (drawTargetArrow) {
1968
1954
  const tipDir = directionTowardTip(samples, clip.endIndex, clip.endPoint, -1);
@@ -2116,7 +2102,6 @@ var retreatFromPoint = (samples, clippedIndex, clipPoint, dist, direction) => {
2116
2102
  y: clipPoint.y - dy / len * dist * Math.min(1, t)
2117
2103
  };
2118
2104
  };
2119
- var negateVec = (v) => ({ x: -v.x, y: -v.y });
2120
2105
 
2121
2106
  // src/node-types/define-node.ts
2122
2107
  var DEFAULT_LOD = {
@@ -2296,7 +2281,7 @@ var createDefaultTextareaEditor = ({
2296
2281
  ta.style.whiteSpace = "pre-wrap";
2297
2282
  ta.style.wordBreak = "break-word";
2298
2283
  const autosize = () => {
2299
- ta.style.height = "auto";
2284
+ ta.style.height = "0px";
2300
2285
  ta.style.height = `${ta.scrollHeight}px`;
2301
2286
  };
2302
2287
  const commitNow = () => {
@@ -5203,7 +5188,7 @@ var createRenderer = (opts) => {
5203
5188
  ctx.fillStyle = "#94a3b8";
5204
5189
  ctx.textBaseline = "middle";
5205
5190
  ctx.textAlign = "center";
5206
- ctx.font = `italic ${fontPx}px ${node.style?.fontFamily ?? "sans-serif"}`;
5191
+ ctx.font = `italic ${fontPx}px ${FONT_FAMILY_MAP[node.style?.fontFamily ?? "handwriting"]}`;
5207
5192
  ctx.fillText("Type to edit\u2026", node.w / 2, node.h / 2);
5208
5193
  ctx.restore();
5209
5194
  };