Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
59597a15
E
engine
项目概览
qq_34031325
/
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,发现更多精彩内容 >>
提交
59597a15
编写于
3月 16, 2016
作者:
H
Hixie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Path dartdocs
上级
3a48f5b1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
101 addition
and
7 deletion
+101
-7
sky/engine/core/dart/painting.dart
sky/engine/core/dart/painting.dart
+101
-7
未找到文件。
sky/engine/core/dart/painting.dart
浏览文件 @
59597a15
...
...
@@ -38,14 +38,22 @@ void decodeImageFromList(Uint8List list, ImageDecoderCallback callback)
/// A complex, one-dimensional subset of a plane.
///
/// A path consists of a number of segments of various types, such as lines,
/// arcs, or beziers. Paths can be open or closed and can self-intersect. A path
/// also encloses a (possibly discontiguous) region of the plane based on
/// whether a line from a given point on the plane to a point at infinity
/// intersects the path an even (non-enclosed) or an odd (enclosed) number of
/// times.
/// A path consists of a number of subpaths, and a _current point_.
///
/// Paths can be drawn on canvases using [Canvas.drapPath], and can
/// Subpaths consist of segments of various types, such as lines,
/// arcs, or beziers. Subpaths can be open or closed, and can
/// self-intersect.
///
/// Closed subpaths enclose a (possibly discontiguous) region of the
/// plane based on whether a line from a given point on the plane to a
/// point at infinity intersects the path an even (non-enclosed) or an
/// odd (enclosed) number of times.
///
/// The _current point_ is initially at the origin. After each
/// operation adding a segment to a subpath, the current point is
/// updated to the end of that segment.
///
/// Paths can be drawn on canvases using [Canvas.drawPath], and can
/// used to create clip regions using [Canvas.clipPath].
class
Path
extends
NativeFieldWrapperClass2
{
...
...
@@ -53,23 +61,109 @@ class Path extends NativeFieldWrapperClass2 {
Path
()
{
_constructor
();
}
void
_constructor
()
native
"Path_constructor"
;
/// Starts a new subpath at the given coordinate.
void
moveTo
(
double
x
,
double
y
)
native
"Path_moveTo"
;
/// Starts a new subpath at the given offset from the current point.
void
relativeMoveTo
(
double
dx
,
double
dy
)
native
"Path_relativeMoveTo"
;
/// Adds a straight line segment from the current point to the given
/// point.
void
lineTo
(
double
x
,
double
y
)
native
"Path_lineTo"
;
/// Adds a straight line segment from the current point to the point
/// at the given offset from the current point.
void
relativeLineTo
(
double
dx
,
double
dy
)
native
"Path_relativeLineTo"
;
/// Adds a quadratic bezier segment that curves from the current
/// point to the given point (x2,y2), using the control point
/// (x1,y1).
void
quadraticBezierTo
(
double
x1
,
double
y1
,
double
x2
,
double
y2
)
native
"Path_quadraticBezierTo"
;
/// Adds a quadratic bezier segment that curves from the current
/// point to the point at the offset (x2,y2) from the current point,
/// using the control point at the offset (x1,y1) from the current
/// point.
void
relativeQuadraticBezierTo
(
double
x1
,
double
y1
,
double
x2
,
double
y2
)
native
"Path_relativeQuadraticBezierTo"
;
/// Adds a cubic bezier segment that curves from the current point
/// to the given point (x3,y3), using the control points (x1,y1) and
/// (x2,y2).
void
cubicTo
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
)
native
"Path_cubicTo"
;
/// Adds a cubcic bezier segment that curves from the current point
/// to the point at the offset (x3,y3) from the current point, using
/// the control points at the offsets (x1,y1) and (x2,y2) from the
/// current point.
void
relativeCubicTo
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
)
native
"Path_relativeCubicTo"
;
/// Adds a bezier segment that curves from the current point to the
/// given point (x2,y2), using the control points (x1,y1) and the
/// weight w. If the weight is greater than 1, then the curve is a
/// hyperbola; if the weight equals 1, it's a parabola; and if it is
/// less than 1, it is an ellipse.
void
conicTo
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
w
)
native
"Path_conicTo"
;
/// Adds a bezier segment that curves from the current point to the
/// point at the offset (x2,y2) from the current point, using the
/// control point at the offset (x1,y1) from the current point and
/// the weight w. If the weight is greater than 1, then the curve is
/// a hyperbola; if the weight equals 1, it's a parabola; and if it
/// is less than 1, it is an ellipse.
void
relativeConicTo
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
w
)
native
"Path_relativeConicTo"
;
/// If the [forceMoveTo] argument is false, adds a straight line
/// segment and an arc segment.
///
/// If the [forceMoveTo] argument is true, starts a new subpath
/// consisting of an arc segment.
///
/// In either case, the arc segment consists of the arc that follows
/// the edge of the oval bounded by the given rectangle, from
/// startAngle radians around the oval up to startAngle + sweepAngle
/// radians around the oval, with zero radians being the point on
/// the right hand side of the oval that crosses the horizontal line
/// that intersects the center of the rectangle and with positive
/// angles going clockwise around the oval.
///
/// The line segment added if [forceMoveTo] is false starts at the
/// current point and ends at the start of the arc.
void
arcTo
(
Rect
rect
,
double
startAngle
,
double
sweepAngle
,
bool
forceMoveTo
)
native
"Path_arcTo"
;
/// Adds a new subpath that consists of four lines that outline the
/// given rectangle.
void
addRect
(
Rect
rect
)
native
"Path_addRect"
;
/// Adds a new subpath that consists of a curve that forms the
/// ellipse that fills the given rectangle.
void
addOval
(
Rect
oval
)
native
"Path_addOval"
;
/// Adds a new subpath with one arc segment that consists of the arc
/// that follows the edge of the oval bounded by the given
/// rectangle, from startAngle radians around the oval up to
/// startAngle + sweepAngle radians around the oval, with zero
/// radians being the point on the right hand side of the oval that
/// crosses the horizontal line that intersects the center of the
/// rectangle and with positive angles going clockwise around the
/// oval.
void
addArc
(
Rect
oval
,
double
startAngle
,
double
sweepAngle
)
native
"Path_addArc"
;
/// Adds a new subpath that consists of the straight lines and
/// curves needed to form the rounded rectangle described by the
/// argument.
void
addRRect
(
RRect
rrect
)
native
"Path_addRRect"
;
/// Closes the last subpath, as if a straight line had been drawn
/// from the current point to the first point of the subpath.
void
close
()
native
"Path_close"
;
/// Clears the [Path] object of all subpaths, returning it to the
/// same state it had when it was created. The _current point_ is
/// reset to the origin.
void
reset
()
native
"Path_reset"
;
/// Returns a copy of the path with all the segments of every
/// subpath translated by the given offset.
Path
shift
(
Offset
offset
)
native
"Path_shift"
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录