gigaboard 1.4.1 → 1.4.2

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
@@ -161,11 +161,12 @@ function computeDynamicAeroGeometry(text, style, fontSize, isTerminal = true) {
161
161
  const resolvedStyle = style ?? "aero_chisel";
162
162
  const hasText = Boolean(text && text.trim().length > 0);
163
163
  if (!hasText) {
164
- const tipX = 2.8;
165
- const shoulderX = 0.2;
166
- const rearX = -1.2;
167
- const dockX2 = -1.8;
168
- const halfH2 = 2.2;
164
+ const scale2 = Math.max(1, fontSize / 2.45);
165
+ const tipX = 2.8 * scale2;
166
+ const shoulderX = 0.2 * scale2;
167
+ const rearX = -1.2 * scale2;
168
+ const dockX2 = -1.8 * scale2;
169
+ const halfH2 = 2.2 * scale2;
169
170
  const path2 = `M ${rearX},${-halfH2} L ${shoulderX},${-halfH2} L ${tipX},0 L ${shoulderX},${halfH2} L ${rearX},${halfH2} C ${dockX2},${halfH2} ${dockX2},${-halfH2} ${rearX},${-halfH2} Z`;
170
171
  return {
171
172
  path: path2,
@@ -178,16 +179,17 @@ function computeDynamicAeroGeometry(text, style, fontSize, isTerminal = true) {
178
179
  const charWidth = fontSize * 0.6;
179
180
  const textWidth = text.length * charWidth;
180
181
  const halfTextW = textWidth / 2;
181
- const padX = 0.75;
182
- const cabinW = Math.max(3.2, halfTextW + padX);
182
+ const scale = Math.max(1, fontSize / 2.45);
183
+ const padX = 0.75 * scale;
184
+ const cabinW = Math.max(3.2 * scale, halfTextW + padX);
183
185
  const halfH = Math.max(2.3, fontSize * 0.9);
184
- const rearInset = 0.65;
186
+ const rearInset = 0.65 * scale;
185
187
  const dockX = -cabinW - rearInset;
186
188
  let frontLen = 0;
187
189
  let path = "";
188
190
  if (resolvedStyle === "aero_chisel") {
189
191
  if (isTerminal) {
190
- const noseLead = 1.25;
192
+ const noseLead = 1.25 * scale;
191
193
  const tipX = cabinW + noseLead;
192
194
  frontLen = tipX;
193
195
  path = `M ${-cabinW},${-halfH} L ${cabinW},${-halfH} L ${tipX},0 L ${cabinW},${halfH} L ${-cabinW},${halfH} C ${dockX},${halfH} ${dockX},${-halfH} ${-cabinW},${-halfH} Z`;