MCPcopy
hub / github.com/antvis/Infographic / clientToViewport

Function clientToViewport

src/editor/utils/coordinate.ts:24–30  ·  view source on GitHub ↗
(
  svg: SVGSVGElement,
  x: number,
  y: number,
)

Source from the content-addressed store, hash-verified

22}
23
24export function clientToViewport(
25 svg: SVGSVGElement,
26 x: number,
27 y: number,
28): DOMPoint {
29 return new DOMPoint(x, y).matrixTransform(getInverseScreenCTM(svg));
30}
31
32export function getElementViewportBounds(
33 svg: SVGSVGElement,

Callers 6

DragElementClass · 0.90
ZoomWheelClass · 0.90
DragCanvasClass · 0.90
BrushSelectClass · 0.90
coordinate.test.tsFile · 0.90
getElementViewportBoundsFunction · 0.85

Calls 2

getInverseScreenCTMFunction · 0.85
matrixTransformMethod · 0.45

Tested by

no test coverage detected