Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Update types to accept SVGElement | HTMLElement in the constructor #2

@pshihn

Description

@pshihn

I have been using this lib with SVGElements and it works great, but I always need to cast the element to any because constructor takes in HTMLElement.

Bonus feature: Also perform getScreenCTM inverse calculation when SVG, to create clientX, clientY in SVG viewport's coordinate system. When using scaled SVGs, I often do the following:

const point = svg.createSVGPoint();
point.x = changed[0].clientX;
point.y = changed[0].clientY;
const coords = point.matrixTransform(svg.getScreenCTM().inverse());

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions