@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/react.cjs CHANGED
@@ -6133,12 +6133,12 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6133
6133
  if (!isRenderedNode(n)) continue;
6134
6134
  const titleTrimmed = n.title?.trim() ?? "";
6135
6135
  if (!titleTrimmed) continue;
6136
- const titleLen = titleTrimmed.length;
6137
- const expectedW = titleLen * titleFontSize(n.kind) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
6136
+ const expectedW = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind) }) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
6138
6137
  if (expectedW > n.w + 8) {
6139
6138
  push(
6140
6139
  "text-readability",
6141
- `node "${n.id}" title "${n.title}" \u304C node \u5E45 ${n.w}px \u3092\u8D85\u904E\u3059\u308B\u53EF\u80FD\u6027 (\u671F\u5F85 ${expectedW}px)`,
6140
+ // 字ごとの実幅は小数になるので、読む人に出す時だけ丸める (判定は丸めない)
6141
+ `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)`,
6142
6142
  "warn"
6143
6143
  );
6144
6144
  }