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