量规:旋转针
我正在用 raphaeljs 构建一个仪表小部件,从 http://renatoalbano.github.com/raphael-gauge/ 示例..
我不知道不明白为针选择特定“中心”的标准是什么: 在第一个例子中,针的中心是 [140, 5],第二个是 [67, 13]...作者是如何计算的?
..我可以这样放置针吗 或者有必要将其放置在圆/仪表的中间?
i'm building a gauge widget with raphaeljs, starting with
http://renatoalbano.github.com/raphael-gauge/ example..
I don't understand what the criteria is for select a particular "center" for the needle:
in the first example the center of the needle is [140, 5] and the second is [67, 13]... how the author calculate it?
..and can i place the needle like this
or it's necessary to place it in the middle of the circle/gauge?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 http://renatoalbano.github.com/raphael-gauge/gauge -pointer.png
仪表旋转的小点位于原始方向上图像左上角向右 67 像素、向下 13 像素的位置。这就是您需要切片和测量图像的方式。 (“枢轴点”对于 Raphael 文档来说是比“中心点”更好的解释方式,这很令人困惑。)
假设您裁剪了仪表图像,您需要将背景附加到仪表上大约 97、81 处一直到边缘 (~193x193)。
完成后看起来真的很酷;^)
Take a look at http://renatoalbano.github.com/raphael-gauge/gauge-pointer.png
The little dot that the gauge pivots on is 67 px right and 13 px down from the top left of the image in this original orientation. That's how you need to slice and measure your image. ("Pivot point" would be a much better way for Raphael docs to explain it than "center point", it's confusing.)
You'll want to attach your background to the gauge at about 97, 81, assuming you crop that gauge image right to its edges (~193x193).
That's gonna look really cool when it's done ;^)