@canvas-harness/core 0.0.3 → 0.0.5

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
@@ -1055,7 +1055,8 @@ var COMPOSITE = /* @__PURE__ */ new Set([
1055
1055
  "capsule",
1056
1056
  "layered-rect",
1057
1057
  "layered-ellipse",
1058
- "layered-diamond"
1058
+ "layered-diamond",
1059
+ "soft-diamond"
1059
1060
  ]);
1060
1061
  var isCompositePrimitive = (type) => COMPOSITE.has(type);
1061
1062
  var isDrawablePrimitive = (type) => ATOMIC.has(type) || COMPOSITE.has(type);
@@ -1161,6 +1162,30 @@ var compositeLayout = (node) => {
1161
1162
  const front = { atomic, x: 0, y: 0, w, h };
1162
1163
  return [back, front];
1163
1164
  }
1165
+ case "soft-diamond": {
1166
+ const backScale = 1.08;
1167
+ const frontScale = 0.96;
1168
+ const bw = w * backScale;
1169
+ const bh = h * backScale;
1170
+ const fw = w * frontScale;
1171
+ const fh = h * frontScale;
1172
+ const back = {
1173
+ atomic: "diamond",
1174
+ x: (w - bw) / 2,
1175
+ y: (h - bh) / 2,
1176
+ w: bw,
1177
+ h: bh,
1178
+ style: darkenedStyle(node.style)
1179
+ };
1180
+ const front = {
1181
+ atomic: "diamond",
1182
+ x: (w - fw) / 2,
1183
+ y: (h - fh) / 2,
1184
+ w: fw,
1185
+ h: fh
1186
+ };
1187
+ return [back, front];
1188
+ }
1164
1189
  }
1165
1190
  return [];
1166
1191
  };
@@ -4549,7 +4574,8 @@ var contentBounds = (node) => {
4549
4574
  return { x: rectX, y: 0, w: Math.max(0, w - rectX), h };
4550
4575
  }
4551
4576
  case "diamond":
4552
- case "layered-diamond": {
4577
+ case "layered-diamond":
4578
+ case "soft-diamond": {
4553
4579
  const cw = w * SQRT2_INV;
4554
4580
  const ch = h * SQRT2_INV;
4555
4581
  return { x: (w - cw) / 2, y: (h - ch) / 2, w: cw, h: ch };