SVG viewBox Coordinates

北慕城南 提交于 2019-12-10 11:41:23

问题


I'm just learning details about the SVG viewport and viewBox. What I find confusing is, that it seem counter-intuitively, despite all positive x and y coordinates going left to right and top to bottom respectively in web design, the viewBox coordinate system seems to go right to left, and bottom to top respectively?

Am I understanding this correctly, and does anybody know why this is the case.

Thanks


回答1:


This is not correct. viewBox declaration is x, y, width, height. And the origin 0,0 is top left - like most coordinate systems. If you have an example that is different, then it may be that there is a transform being applied at some level of your doc or CSS that is changing behavior.




回答2:


The penny has dropped now. Because you move the viewBox to the right and down it creates the illusion that the graphic is moving to the left and up.



来源:https://stackoverflow.com/questions/51194690/svg-viewbox-coordinates

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!