MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / getPreviewLineStep

Function getPreviewLineStep

packages/app-core/src/components/VimNav.tsx:1673–1681  ·  view source on GitHub ↗
(previewEl: HTMLElement)

Source from the content-addressed store, hash-verified

1671 }
1672
1673 function getPreviewLineStep(previewEl: HTMLElement): number {
1674 const content = previewEl.querySelector<HTMLElement>('[data-preview-content]')
1675 const style = window.getComputedStyle(content ?? previewEl)
1676 const lineHeight = Number.parseFloat(style.lineHeight)
1677 if (Number.isFinite(lineHeight)) return Math.max(20, lineHeight)
1678 const fontSize = Number.parseFloat(style.fontSize)
1679 if (Number.isFinite(fontSize)) return Math.max(20, fontSize * 1.6)
1680 return 28
1681 }
1682
1683 function getPreviewPageStep(previewEl: HTMLElement): number {
1684 return Math.max(96, Math.round(previewEl.clientHeight * 0.5))

Callers 1

handlePreviewKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected