Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
b7f21490
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,发现更多精彩内容 >>
提交
b7f21490
编写于
5月 10, 2017
作者:
I
Ian Hickson
提交者:
GitHub
5月 10, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add documentation to TileMode. (#3668)
上级
813623a3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
10 deletion
+58
-10
lib/ui/painting.dart
lib/ui/painting.dart
+58
-10
未找到文件。
lib/ui/painting.dart
浏览文件 @
b7f21490
...
...
@@ -196,7 +196,7 @@ class Color {
/// can be used to blend the pixels. The image below shows the effects
/// of these modes.
///
/// [![Open Skia fiddle to view image.](https://flutter.github.io/assets-for-api-docs/
transfer
_mode.png)](https://fiddle.skia.org/c/864acd0659c7a866ea7296a3184b8bdd)
/// [![Open Skia fiddle to view image.](https://flutter.github.io/assets-for-api-docs/
dart-ui/blend
_mode.png)](https://fiddle.skia.org/c/864acd0659c7a866ea7296a3184b8bdd)
///
/// See [Paint.blendMode].
enum
BlendMode
{
...
...
@@ -950,15 +950,54 @@ class ImageFilter extends NativeFieldWrapperClass2 {
abstract
class
Shader
extends
NativeFieldWrapperClass2
{
}
/// Defines what happens at the edge of the gradient.
///
/// A gradient is defined along a finite inner area. In the case of a linear
/// gradient, it's between the parallel lines that are orthogonal to the line
/// drawn between two points. In the case of radial gradients, it's the disc
/// that covers the circle centered on a particular point up to a given radius.
///
/// This enum is used to define how the gradient should paint the regions
/// outside that defined inner area.
///
/// See also:
///
/// * [painting.Gradient], the superclass for [LinearGradient] and
/// [RadialGradient], as used by [BoxDecoration] et al, which works in
/// relative coordinates and can create a [Shader] representing the gradient
/// for a particular [Rect] on demand.
/// * [dart:ui.Gradient], the low-level class used when dealing with the
/// [Paint.shader] property directly, with its [new Gradient.linear] and [new
/// Gradient.radial] constructors.
enum
TileMode
{
/// Edge is clamped to the final color.
///
/// The gradient will paint the all the regions outside the inner area with
/// the color of the point closest to that region.
///
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_linear.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_radial.png)
clamp
,
/// Edge is repeated from first color to last.
repeated
,
/// Edge is mirrored from last color to first.
///
/// This is as if the stop points from 0.0 to 1.0 were then repeated backwards
/// from 2.0 to 1.0, then forwards from 2.0 to 3.0, then backwards again from
/// 4.0 to 3.0, and so forth (and for linear gradients, similarly from in the
/// negative direction).
///
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_linear.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_radial.png)
mirror
,
/// Edge is repeated from first color to last.
///
/// This is as if the stop points from 0.0 to 1.0 were then repeated from 1.0
/// to 2.0, 2.0 to 3.0, and so forth (and for linear gradients, similarly from
/// -1.0 to 0.0, -2.0 to -1.0, etc).
///
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_linear.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_radial.png)
repeated
,
}
Int32List
_encodeColorList
(
List
<
Color
>
colors
)
{
...
...
@@ -1011,7 +1050,11 @@ class Gradient extends Shader {
/// `color` must therefore only have two entries).
///
/// The behavior before `from` and after `to` is described by the `tileMode`
/// argument.
/// argument. For details, see the [TileMode] enum.
///
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_linear.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_linear.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_linear.png)
///
/// If `from`, `to`, `colors`, or `tileMode` are null, or if `colors` or
/// `colorStops` contain null values, this constructor will throw a
...
...
@@ -1021,7 +1064,7 @@ class Gradient extends Shader {
Offset
to
,
List
<
Color
>
colors
,
[
List
<
double
>
colorStops
=
null
,
TileMode
tileMode
=
TileMode
.
clamp
TileMode
tileMode
=
TileMode
.
clamp
,
])
{
_validateColorStops
(
colors
,
colorStops
);
final
Float32List
endPointsBuffer
=
_encodeTwoPoints
(
from
,
to
);
...
...
@@ -1041,16 +1084,21 @@ class Gradient extends Shader {
/// `color` must therefore only have two entries).
///
/// The behavior before and after the radius is described by the `tileMode`
/// argument.
/// argument. For details, see the [TileMode] enum.
///
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_radial.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_radial.png)
/// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_radial.png)
///
/// If `center`, `radius`, `colors`, or `tileMode` are null, or if `colors` or
/// `colorStops` contain null values, this constructor will throw a
/// [NoSuchMethodError].
Gradient
.
radial
(
Offset
center
,
double
radius
,
List
<
Color
>
colors
,
[
List
<
double
>
colorStops
=
null
,
TileMode
tileMode
=
TileMode
.
clamp
])
{
List
<
Color
>
colors
,
[
List
<
double
>
colorStops
=
null
,
TileMode
tileMode
=
TileMode
.
clamp
,
])
{
_validateColorStops
(
colors
,
colorStops
);
final
Int32List
colorsBuffer
=
_encodeColorList
(
colors
);
final
Float32List
colorStopsBuffer
=
colorStops
==
null
?
null
:
new
Float32List
.
fromList
(
colorStops
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录