您现在的位置是:首页 > 电脑 > 

获得一组拉斐尔物体的BBox?(Get BBox of a GROUP of Raphael objects?)

2025-07-19 06:33:32
获得一组拉斐尔物体的BBox?(Get BBox of a GROUP of Raphael objects?) 获得几个拉斐尔物体整体的边界框的最好方法是什么? 我可以把它们放在一个set并调用mySet.getBBox() ? 或者我需要循环遍历它们,为每一个获得bbox并计算总体高度和宽度? (另外,我不能直接使用SVG - 我需要VML
获得一组拉斐尔物体的BBox?(Get BBox of a GROUP of Raphael objects?)

获得几个拉斐尔物体整体的边界框的最好方法是什么?

我可以把它们放在一个set并调用mySet.getBBox() ?

或者我需要循环遍历它们,为每一个获得bbox并计算总体高度和宽度?

(另外,我不能直接使用SVG - 我需要VML支持。)

What's the best way to get the bounding box of several Raphael objects as a whole?

Can I put them all in a set and call mySet.getBBox()?

Or do I need to loop through them all, get bbox for each one and calculate the overall height and width?

(Also, I can't use SVG directly - I need VML support.)

最满意答案

呃。 这很容易。 (谢谢@Dylan):

var paper = Raphael ('test', 100, 100); var circles = paper.set(); var c1 = (70,0,10); var c2 = (50,10,10); var c = (10,80,10); circles.push(c1, c2, c); alert(c.getBBox().width); // --> 20 alert(circles.getBBox().width); // --> 80

Uh. It's really easy. (Thanks @Dylan):

var paper = Raphael ('test', 100, 100); var circles = paper.set(); var c1 = (70,0,10); var c2 = (50,10,10); var c = (10,80,10); circles.push(c1, c2, c); alert(c.getBBox().width); // --> 20 alert(circles.getBBox().width); // --> 80

#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格

本文地址:http://www.dnpztj.cn/diannao/697357.html

相关标签:无
上传时间: 2023-08-27 09:40:28
留言与评论(共有 20 条评论)
本站网友 长财大智慧
4分钟前 发表
10); circles.push(c1
本站网友 内地票房排行榜
12分钟前 发表
I can't use SVG directly - I need VML support.) 最满意答案 呃
本站网友 整形法令纹
25分钟前 发表
10
本站网友 天津体检中心
5分钟前 发表
0
本站网友 男性减肥
20分钟前 发表
c2
本站网友 北京二手房首付比例
9分钟前 发表
10); var c2 = (50
本站网友 王者丑生
5分钟前 发表
80
本站网友 世界制药原料中国展
3分钟前 发表
10); circles.push(c1
本站网友 观光业
1分钟前 发表
c); alert(c.getBBox().width); // --> 20 alert(circles.getBBox().width); // --> 80
本站网友 明仕山庄
18分钟前 发表
c2
本站网友 bitget
8分钟前 发表
) What's the best way to get the bounding box of several Raphael objects as a whole? Can I put them all in a set and call mySet.getBBox()? Or do I need to loop through them all
本站网友 偏头疼快速止疼妙招
2分钟前 发表
10); var c = (10
本站网友 武汉房产
19分钟前 发表
100); var circles = paper.set(); var c1 = (70
本站网友 臻园
15分钟前 发表
获得一组拉斐尔物体的BBox?(Get BBox of a GROUP of Raphael objects?) 获得几个拉斐尔物体整体的边界框的最好方法是什么? 我可以把它们放在一个set并调用mySet.getBBox() ? 或者我需要循环遍历它们
本站网友 刘一帆
12分钟前 发表
10); circles.push(c1
本站网友 郑州移动公司
11分钟前 发表
获得一组拉斐尔物体的BBox?(Get BBox of a GROUP of Raphael objects?) 获得几个拉斐尔物体整体的边界框的最好方法是什么? 我可以把它们放在一个set并调用mySet.getBBox() ? 或者我需要循环遍历它们
本站网友 曼施坦因
3分钟前 发表
80
本站网友 大脑结构图
22分钟前 发表
100
本站网友 人民铁道
23分钟前 发表
I can't use SVG directly - I need VML support.) 最满意答案 呃