chore: remove dead code and duplicate logic

- drop unused assertNever, canvg dependency (never imported),
  readonly re-export shim in VertebraPicker, stale equine named export
- unexport validateBoneElement (internal only)
- getBoneIdFromEvent now delegates to getAnnotatedElement (dup walk-up)
- rasterizeSvg: drop ignored _scale param (2 call sites + tests)
- extract byte-identical word-wrap into pdf/render/text.ts
- extract mergeBones helper in EditorRoute (block duplicated twice)
- fix stale canvg comment in observationPage
Checks: typecheck, lint, 174/174 tests, build all green
This commit is contained in:
Bastien Chanot committed 2026-07-12 04:47:54 +02:00
1 parent c55da07697
commit bbdc0e851a
14 files changed
+55 -141

No files matched your search

+1 -7
View File
@@ -113,14 +113,8 @@ async function canvasToPngBytes(canvas: HTMLCanvasElement): Promise<Uint8Array>
* the inline anatomy canvas.
*
* @param svgString Serialized SVG (must declare `xmlns`)
* @param _scale Reserved — current implementation renders at a fixed
* TARGET_WIDTH derived from the viewBox; kept for API
* compatibility.
*/
export async function rasterizeSvg(
svgString: string,
_scale: number,
): Promise<Uint8Array> {
export async function rasterizeSvg(svgString: string): Promise<Uint8Array> {
const { widthPx, heightPx } = readViewBox(svgString)
const canvas = await rasterizeWithImageElement(svgString, widthPx, heightPx)
return canvasToPngBytes(canvas)