Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
39a99b00
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,发现更多精彩内容 >>
未验证
提交
39a99b00
编写于
1月 10, 2019
作者:
J
Justin McCandless
提交者:
GitHub
1月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Docs improvements per @Hixie's comments (#7387)
上级
26e02aaa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
15 deletion
+19
-15
lib/ui/text.dart
lib/ui/text.dart
+19
-15
未找到文件。
lib/ui/text.dart
浏览文件 @
39a99b00
...
...
@@ -882,43 +882,47 @@ class TextBox {
/// characters. For newline characters, the position is fully specified by the
/// offset alone, and there is no ambiguity.
///
///
TextAffinity
also affects bidirectional text at the interface between LTR
///
[TextAffinity]
also affects bidirectional text at the interface between LTR
/// and RTL text. Consider the following string, where the lowercase letters
/// will be displayed as LTR and the uppercase letters RTL: "helloHELLO". When
/// rendered, the string would appear visually as "helloOLLEH". An offset of 5
/// would be ambiguous without a corresponding
TextAffinity
. Looking at the
/// would be ambiguous without a corresponding
[TextAffinity]
. Looking at the
/// string in code, the offset represents the position just after the "o" and
/// just before the "H". When rendered, this offset could be either in the
/// middle of the string to the right of the "o" or at the end of the string to
/// the right of the "H".
enum
TextAffinity
{
/// The position has affinity for the upstream side of the text position,
or
/// The position has affinity for the upstream side of the text position,
i.e.
/// in the direction of the beginning of the string.
///
/// In the example of an offset at the place where text is wrapping, upstream
/// indicates the end of the first line.
///
/// In the bidirectional text example above, an offset of 5 with TextAffinity
/// upstream would appear in the middle of the rendered text, just to the
/// right of the "o".
/// In the bidirectional text example "helloHELLO", an offset of 5 with
/// [TextAffinity] upstream would appear in the middle of the rendered text,
/// just to the right of the "o". See the definition of [TextAffinity] for the
/// full example.
upstream
,
/// The position has affinity for the downstream side of the text position,
or
/// in the direction of the end of the string.
/// The position has affinity for the downstream side of the text position,
/// i
.e. i
n the direction of the end of the string.
///
/// In the example of an offset at the place where text is wrapping,
/// downstream indicates the beginning of the second line.
///
/// In the bidirectional text example above, an offset of 5 with TextAffinity
/// downstream would appear at the end of the rendered text, just to the right
/// of the "H".
/// In the bidirectional text example "helloHELLO", an offset of 5 with
/// [TextAffinity] downstream would appear at the end of the rendered text,
/// just to the right of the "H". See the definition of [TextAffinity] for the
/// full example.
downstream
,
}
/// A position in a string of text. A TextPosition can be used to locate a
/// position in a string in code (using the [offset] property), and it can also
/// be used to locate the same position visually in a rendered string of text
/// (using [offset] and, when needed to resolve ambiguity, [affinity]).
/// A position in a string of text.
///
/// A TextPosition can be used to locate a position in a string in code (using
/// the [offset] property), and it can also be used to locate the same position
/// visually in a rendered string of text (using [offset] and, when needed to
/// resolve ambiguity, [affinity]).
///
/// The location of an offset in a rendered string is ambiguous in two cases.
/// One happens when rendered text is forced to wrap. In this case, the offset
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录