aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bluebey-studio/src
diff options
context:
space:
mode:
Diffstat (limited to 'public/bluebey-studio/src')
-rw-r--r--public/bluebey-studio/src/caption.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/public/bluebey-studio/src/caption.js b/public/bluebey-studio/src/caption.js
index d0318e7..7865295 100644
--- a/public/bluebey-studio/src/caption.js
+++ b/public/bluebey-studio/src/caption.js
@@ -100,7 +100,7 @@ const COLUMN_END_FORBIDDEN = new Set(['「', '『', '(', '〔', '【', '〈',
const VERTICAL_OFFSETS = new Map();
for (const ch of SMALL_KANA) VERTICAL_OFFSETS.set(ch, { dx: 0.12, dy: -0.12 });
// 縦書きの句読点は、横書きの左下ではなく、字枠の右上に置く。
-for (const ch of HANGING_PUNCTUATION) VERTICAL_OFFSETS.set(ch, { dx: 0.3, dy: -0.3 });
+for (const ch of HANGING_PUNCTUATION) VERTICAL_OFFSETS.set(ch, { dx: 0.55, dy: -0.8 });
for (const ch of '「『(〔') VERTICAL_OFFSETS.set(ch, { dx: 0.14, dy: -0.12 });
for (const ch of '」』)〕') VERTICAL_OFFSETS.set(ch, { dx: -0.14, dy: 0.12 });
@@ -831,10 +831,20 @@ function thinkEdges(box, scale) {
const a = points[i];
const b = points[(i + 1) % points.length];
const mid = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
- const nx = mid.x - cx;
- const ny = mid.y - cy;
- const length = Math.hypot(nx, ny) || 1;
- edges.push(scallopEdge(a, b, { x: nx / length, y: ny / length }, amp));
+ // Bulge perpendicular to the edge, not away from the centre: on a wide box
+ // the centre direction points sideways along the top and bottom edges, which
+ // is what tilted those scallops. The sign is flipped so it always faces out,
+ // which makes every edge scallop the same way the left and right ones do.
+ const dx = b.x - a.x;
+ const dy = b.y - a.y;
+ const length = Math.hypot(dx, dy) || 1;
+ let nx = -dy / length;
+ let ny = dx / length;
+ if (nx * (mid.x - cx) + ny * (mid.y - cy) < 0) {
+ nx = -nx;
+ ny = -ny;
+ }
+ edges.push(scallopEdge(a, b, { x: nx, y: ny }, amp));
}
return { edges, amp };
}
@@ -869,9 +879,10 @@ function thoughtTrail(box, state, scale, outer) {
// Sized from the font, not the leftover room, so the puffs stay visible at any
// bubble size; they start just outside the cloud (`outer`) and shrink away.
const unit = resolveFontSize(state, scale);
- const r1 = unit * 0.6;
- const r2 = unit * 0.42;
- const r3 = unit * 0.26;
+ // 80% of the first cut, which read a touch large.
+ const r1 = unit * 0.48;
+ const r2 = unit * 0.34;
+ const r3 = unit * 0.21;
const gap = unit * 0.5;
const d1 = outer + r1;
const d2 = d1 + r1 + gap;