Raphael.js API之Raphael.pathIntersection(),Raphael.pathToRelative(),Set.clear(),Set.exclude(element)
来源:互联网 发布:数据线线接口有哪几种 编辑:程序博客网 时间:2024/05/16 02:38
/*API-141*/
Raphael.pathIntersection(path1, path2)
获取两条线的交点
参数列表:
path1
字符串类型
路径的字符串表达形式
path2
字符串类型
路径的字符串表达形式
返回值:交点集合,格式如下:
[{
x: //number类型 点的x坐标
y: //number类型 点的y坐标
t1: //number类型 value for segment of path1(不太确定中文表达方法)
t2: //number类型 value for segment of path2(不太确定中文表达方法)
segment1: //number类型 order number for segment of path1(不太确定中文表达方法)
segment2: //number类型 order number for segment of path2(不太确定中文表达方法)
bez1: //数组 用8个点代表曲线
bez2: //数组 用8个点代表曲线
}]
示例:
var ppath = paper.path("M 300 400 l 200 500");
var ppath1 = paper.path("M 250 400 l 400 150");
var result = Raphael.pathIntersection(ppath.attr("path"), ppath1.attr("path"));
如果调用结果可以写成result[0].x即可取到交点x坐标
返回结果为:
0: Object
bez1: Array[8]
bez2: Array[8]
segment1: 1
segment2: 1
t1: 0.12666743349882026
t2: 0.24168959150532024
x: 308.8235294117614
y: 422.0588235294119
__proto__: Object
length: 1
__proto__: Array[0]
/*API-142*/
Raphael.pathToRelative(pathString)
将路径转变为相对应的形式
参数列表:
pathString
字符串数组
线段数组
返回值:线段数组
/*API-156 API-157*/
Set.clear()
删除set中的所有元素
/*API-157*/
Set.exclude(element)
从set中删除选定元素
参数列表:
element
Object类型
待删除的元素
返回值:布尔类型 (如果待删除的元素在set中找到,并删除返回true)
0 0
- Raphael.js API之Raphael.pathIntersection(),Raphael.pathToRelative(),Set.clear(),Set.exclude(element)
- Raphael.js API之Raphael.svg(),Element.paper,Element.pause(),Raphael.pathBBox(),Raphael.st,Raphael.el
- Raphael.js API之 Element.raphael,Paper.raphael,Paper.print()
- Raphael.js API之Set.forEach(),Set.pop().Set.push(),Set.splice(),eve.listeners(),Raphael.parsePathStri
- Raphael.js API之Raphael.getPointAtLength(),Paper.forEach(),Paper.remove(),Paper.set(),Paper.setStart(
- Raphael.js API之 Raphael.getTotalLength(),Raphael.fn
- Raphael.js API 之 Element.attr()
- Raphael.js API之Element.id,Element.insertAfter(),Element.insertBefore(),Element.hide(),Paper.clear(),
- Raphael.js API之Element.clone(),Element.data(),Element.dblclick()
- Raphael.js API之Element.drag(),Element.toBack()
- Raphael
- Raphael.js API之Paper.image(),Element.animate()
- Raphael.js API之 Paper.path(),Element.click()
- Raphael.js API之 Animation.delay(),Animation.repeat(),Element.animateWith()
- raphael js 中set 的妙用
- Raphael.js API之Raphael.angle(),Raphael.rad(), Paper.customAttributes,Paper.renderfix()
- Raphael.js API之Element.mousedown(),Element.mousemove(),Element.mouseup(),Element.mouseout(),Element.
- Raphael.js API 之Element.remove(),Element.removeData(),paper.text(),Element.node(),Element.onDragOver
- iconv 文件编码转换
- Quartz之CronExpression
- Ubuntu 更改文件夹及子文件夹权限
- 将场景导出XML或JSON或二进制并且解析还原场景
- 腾讯2014校园招聘软件开发类笔试
- Raphael.js API之Raphael.pathIntersection(),Raphael.pathToRelative(),Set.clear(),Set.exclude(element)
- 怎么在左上角加各种选项(开始,游戏攻略,帮助之类的)
- 生成jar包后调用,出现java.lang.NoSuchMethod 分析
- HDU1540 Tunnel Warfare
- Android Wear Preview- 为通知添加多个页面(Adding Pages to a Notification)
- 判断单链表中是否有环,计算出环的首地址 C语言实现
- 希望我可以温柔的对待这个世界
- nginx反向代理时,X-Forwarded-For 如何设置
- getParameter和getAttribute的区别