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