MCPcopy
hub / github.com/markmap/markmap / _getHighlightRect

Method _getHighlightRect

packages/markmap-view/src/view.ts:303–315  ·  view source on GitHub ↗
(highlight: INode)

Source from the content-addressed store, hash-verified

301 }
302
303 private _getHighlightRect(highlight: INode) {
304 const svgNode = this.svg.node()!;
305 const transform = zoomTransform(svgNode);
306 const padding = 4 / transform.k;
307 const rect = {
308 ...highlight.state.rect,
309 };
310 rect.x -= padding;
311 rect.y -= padding;
312 rect.width += 2 * padding;
313 rect.height += 2 * padding;
314 return rect;
315 }
316
317 async renderData(originData?: INode) {
318 const { paddingX, autoFit, color, maxWidth, lineWidth } = this.options;

Callers 1

renderDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected