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