Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'fix: form question types and SVG dimension parsing (#559 #556)' (#339) from fix/low-bugs-batch5 into main

scott 0f8b0001 5f4e0822

+8 -4
+6 -4
src/diagrams/export.ts
··· 386 386 */ 387 387 export function exportToPNG(svgString: string, scale = 2): Promise<Blob> { 388 388 return new Promise((resolve, reject) => { 389 - const match = svgString.match(/width="(\d+(?:\.\d+)?)" height="(\d+(?:\.\d+)?)"/); 390 - if (!match) { 389 + // Parse width and height independently — handles any attribute order and negative values 390 + const wMatch = svgString.match(/width="(-?\d+(?:\.\d+)?)"/); 391 + const hMatch = svgString.match(/height="(-?\d+(?:\.\d+)?)"/); 392 + if (!wMatch || !hMatch) { 391 393 reject(new Error('Cannot determine SVG dimensions from width/height attributes')); 392 394 return; 393 395 } 394 396 395 - const baseWidth = parseFloat(match[1] ?? '0'); 396 - const baseHeight = parseFloat(match[2] ?? '0'); 397 + const baseWidth = Math.abs(parseFloat(wMatch[1])); 398 + const baseHeight = Math.abs(parseFloat(hMatch[1])); 397 399 const width = baseWidth * scale; 398 400 const height = baseHeight * scale; 399 401
+2
src/forms/question-types.ts
··· 21 21 { type: 'date', label: 'Date', icon: '\uD83D\uDCC5' }, 22 22 { type: 'rating', label: 'Rating', icon: '\u2605' }, 23 23 { type: 'scale', label: 'Scale', icon: '\u229E' }, 24 + { type: 'url', label: 'URL', icon: '\uD83D\uDD17' }, 25 + { type: 'file_upload', label: 'File Upload', icon: '\uD83D\uDCCE' }, 24 26 ]; 25 27 26 28 /** Question types that use an options list */