@cardenelabs/cdl 0.105.0 → 0.106.0

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
@@ -17223,12 +17223,12 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17223
17223
  if (!isRenderedNode(n)) continue;
17224
17224
  const titleTrimmed = n.title?.trim() ?? "";
17225
17225
  if (!titleTrimmed) continue;
17226
- const titleLen = titleTrimmed.length;
17227
- const expectedW = titleLen * titleFontSize(n.kind) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
17226
+ const expectedW = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind) }) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
17228
17227
  if (expectedW > n.w + 8) {
17229
17228
  push(
17230
17229
  "text-readability",
17231
- `node "${n.id}" title "${n.title}" \u304C node \u5E45 ${n.w}px \u3092\u8D85\u904E\u3059\u308B\u53EF\u80FD\u6027 (\u671F\u5F85 ${expectedW}px)`,
17230
+ // 字ごとの実幅は小数になるので、読む人に出す時だけ丸める (判定は丸めない)
17231
+ `node "${n.id}" title "${n.title}" \u304C node \u5E45 ${n.w}px \u3092\u8D85\u904E\u3059\u308B\u53EF\u80FD\u6027 (\u671F\u5F85 ${Math.round(expectedW)}px)`,
17232
17232
  "warn"
17233
17233
  );
17234
17234
  }