为什么HTML/SVG坐标0,0从左上角开始? [英] Why do HTML/SVG Coordinate 0,0 starts at top left corner?

查看:477
本文介绍了为什么HTML/SVG坐标0,0从左上角开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅想知道HTML/SVG在浏览器中将0,0表示为左上角是什么原因?有什么好处吗?

与传统观点(经典几何学)相反,Y值在屏幕上越低,其值就越大.

解决方案

因为早于SVG的CSS的工作原理.

在大多数情况下,例如独立的SVG文档或嵌入(通过引用或内联)在XML父文档中的SVG文档片段,其中父文档的布局由CSS [CSS2]或XSL [XSL]确定,初始视口坐标系(因此也就是初始用户坐标系)的原点位于视口的顶部/左侧,正x轴指向右侧,正y轴指向下方,

Just wondering whats the reasoning behind saying 0,0 as top left corner in browser by both HTML/SVG? Are there any advantage to this?

It goes against conventional wisdom (classic geometry) that the Y values become greater in value the lower they are on the screen.

解决方案

Because that's how CSS which predates SVG works.

In most cases, such as stand-alone SVG documents or SVG document fragments embedded (by reference or inline) within XML parent documents where the parent's layout is determined by CSS [CSS2] or XSL [XSL], the initial viewport coordinate system (and therefore the initial user coordinate system) has its origin at the top/left of the viewport, with the positive x-axis pointing towards the right, the positive y-axis pointing down,

这篇关于为什么HTML/SVG坐标0,0从左上角开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆