Skip to content

Graph Viewer zoom fixed.

Choose a tag to compare

@debritto debritto released this 29 Apr 18:45
· 1 commit to main since this release

[0.5.30] - 2026-04-29

Fixed

  • Zoom do Graph Viewer (src/viewers/graphViewer.js)
    • Causa raiz: o <script> do webview não tinha atributo nonce, fazendo a CSP (script-src 'nonce-{nonce}') bloquear silenciosamente todo o JavaScript customizado — botões +/−/Reset e scroll wheel não respondiam.
    • Atributo nonce="${nonce}" adicionado ao <script> tag principal.
    • Atributos onclick="..." substituídos por id nos três botões + addEventListener no script — inline event handlers são bloqueados por CSP mesmo com nonce.
    • svg.getBBox() envolvido em requestAnimationFrame para garantir que o SVG esteja pintado antes da leitura de dimensões no auto-fit inicial; guard svgWidth > 0 && svgHeight > 0 adicionado para evitar cálculo com dimensões nulas.