Skip to content

This is an experiment to transform coordinates from the viewport space (`clientX`, `clientY`) into the local SVG without using `svg.getScreenCTM()`.

Notifications You must be signed in to change notification settings

laszlokorte/svg-viewbox-trans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot of the app

Live Demo

Manual SVG ViewBox calculation

This is an experiment to transform coordinates from the viewport space (clientX, clientY) into the local SVG without using svg.getScreenCTM(). The reason for not using getScreenCTM() is to be able to do the calculations without updating the SVG DOM element.

Configure the SVG element and ViewBox size and alignment as you like and then click inside the SVG. The red dot shoult be placed correctly at the click position.

About

This is an experiment to transform coordinates from the viewport space (`clientX`, `clientY`) into the local SVG without using `svg.getScreenCTM()`.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published