Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
398ec7f8
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
398ec7f8
编写于
12月 05, 2015
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2146 from abarth/path_functions
Add a bunch of missing Path functions
上级
3df1de91
19f6331a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
30 addition
and
17 deletion
+30
-17
sky/engine/core/painting/CanvasPath.h
sky/engine/core/painting/CanvasPath.h
+17
-16
sky/engine/core/painting/Path.idl
sky/engine/core/painting/Path.idl
+13
-1
未找到文件。
sky/engine/core/painting/CanvasPath.h
浏览文件 @
398ec7f8
...
...
@@ -9,6 +9,7 @@
#include "sky/engine/core/painting/Offset.h"
#include "sky/engine/core/painting/Rect.h"
#include "sky/engine/core/painting/RRect.h"
#include "sky/engine/tonic/dart_wrappable.h"
#include "sky/engine/wtf/PassRefPtr.h"
#include "sky/engine/wtf/RefCounted.h"
...
...
@@ -29,25 +30,25 @@ public:
return
adoptRef
(
new
CanvasPath
);
}
void
moveTo
(
float
x
,
float
y
)
{
m_path
.
moveTo
(
x
,
y
);
}
void
lineTo
(
float
x
,
float
y
)
{
m_path
.
lineTo
(
x
,
y
);
}
void
arcTo
(
const
Rect
&
rect
,
float
startAngle
,
float
sweepAngle
,
bool
forceMoveTo
)
{
void
moveTo
(
float
x
,
float
y
)
{
m_path
.
moveTo
(
x
,
y
);
}
void
relativeMoveTo
(
float
x
,
float
y
)
{
m_path
.
rMoveTo
(
x
,
y
);
}
void
lineTo
(
float
x
,
float
y
)
{
m_path
.
lineTo
(
x
,
y
);
}
void
relativeLineTo
(
float
x
,
float
y
)
{
m_path
.
rLineTo
(
x
,
y
);
}
void
quadraticBezierTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
)
{
m_path
.
quadTo
(
x1
,
y1
,
x2
,
y2
);
}
void
relativeQuadraticBezierTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
)
{
m_path
.
rQuadTo
(
x1
,
y1
,
x2
,
y2
);
}
void
cubicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
x3
,
float
y3
)
{
m_path
.
cubicTo
(
x1
,
y1
,
x2
,
y2
,
x3
,
y3
);
}
void
relativeCubicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
x3
,
float
y3
)
{
m_path
.
rCubicTo
(
x1
,
y1
,
x2
,
y2
,
x3
,
y3
);
}
void
conicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
w
)
{
m_path
.
conicTo
(
x1
,
y1
,
x2
,
y2
,
w
);
}
void
relativeConicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
w
)
{
m_path
.
rConicTo
(
x1
,
y1
,
x2
,
y2
,
w
);
}
void
arcTo
(
const
Rect
&
rect
,
float
startAngle
,
float
sweepAngle
,
bool
forceMoveTo
)
{
m_path
.
arcTo
(
rect
.
sk_rect
,
startAngle
*
180.0
/
M_PI
,
sweepAngle
*
180.0
/
M_PI
,
forceMoveTo
);
}
void
addOval
(
const
Rect
&
oval
)
{
m_path
.
add
Oval
(
oval
.
sk_rect
);
void
addRect
(
const
Rect
&
rect
)
{
m_path
.
addRect
(
rect
.
sk_rect
);
}
void
addOval
(
const
Rect
&
oval
)
{
m_path
.
addOval
(
oval
.
sk_rect
);
}
void
addArc
(
const
Rect
&
rect
,
float
startAngle
,
float
sweepAngle
)
{
m_path
.
add
Arc
(
rect
.
sk_rect
,
startAngle
*
180.0
/
M_PI
,
sweepAngle
*
180.0
/
M_PI
);
}
void
addRRect
(
const
RRect
&
rrect
)
{
m_path
.
addRRect
(
rrect
.
sk_rrect
);
}
void
close
()
{
...
...
sky/engine/core/painting/Path.idl
浏览文件 @
398ec7f8
...
...
@@ -7,11 +7,23 @@
ImplementedAs
=
CanvasPath
,
]
interface
Path
{
void
moveTo
(
float
x
,
float
y
)
;
void
relativeMoveTo
(
float
dx
,
float
dy
)
;
void
lineTo
(
float
x
,
float
y
)
;
void
relativeLineTo
(
float
dx
,
float
dy
)
;
void
quadraticBezierTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
)
;
void
relativeQuadraticBezierTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
)
;
void
cubicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
x3
,
float
y3
)
;
void
relativeCubicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
x3
,
float
y3
)
;
void
conicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
w
)
;
void
relativeConicTo
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
w
)
;
void
arcTo
(
Rect
rect
,
float
startAngle
,
float
sweepAngle
,
boolean
forceMoveTo
)
; // angles in radians
void
addRect
(
Rect
rect
)
;
void
addOval
(
Rect
oval
)
;
void
close
()
;
void
addArc
(
Rect
oval
,
float
startAngle
,
float
sweepAngle
)
; // angles in radians
void
addRRect
(
RRect
rrect
)
;
void
close
()
;
void
reset
()
;
Path
shift
(
Offset
offset
)
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录