Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
d7d625b2
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
d7d625b2
编写于
7月 17, 2015
作者:
C
Collin Jackson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update example
上级
1c440b15
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
16 deletion
+11
-16
sky/sdk/example/rendering/align_items.dart
sky/sdk/example/rendering/align_items.dart
+10
-15
sky/sdk/lib/rendering/box.dart
sky/sdk/lib/rendering/box.dart
+1
-1
未找到文件。
sky/sdk/example/rendering/align_items.dart
浏览文件 @
d7d625b2
...
@@ -16,39 +16,34 @@ import 'solid_color_box.dart';
...
@@ -16,39 +16,34 @@ import 'solid_color_box.dart';
void
main
(
)
{
void
main
(
)
{
var
table
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
var
table
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
void
addRow
(
FlexAlignItems
align
)
{
for
(
FlexAlignItems
alignItems
in
FlexAlignItems
.
values
)
{
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
"
${align}
"
)]));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
"
${align
Items
}
"
)]));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
var
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
var
row
=
new
RenderFlex
(
alignItems:
alignItems
);
style
=
new
TextStyle
(
fontSize:
15.0
,
color:
const
Color
(
0xFF000000
));
style
=
new
TextStyle
(
fontSize:
15.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
F
FFFCCCC
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
7
FFFCCCC
)),
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo'
)]))
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo'
)]))
));
));
style
=
new
TextStyle
(
fontSize:
10.0
,
color:
const
Color
(
0xFF000000
));
style
=
new
TextStyle
(
fontSize:
10.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
F
FCCFFCC
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
7
FCCFFCC
)),
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo'
)]))
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo'
)]))
));
));
var
subrow
=
new
RenderFlex
(
alignItems:
alignItems
);
style
=
new
TextStyle
(
fontSize:
25.0
,
color:
const
Color
(
0xFF000000
));
style
=
new
TextStyle
(
fontSize:
25.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
sub
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
F
FCCCCFF
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
7
FCCCCFF
)),
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo foo'
)]))
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo foo'
)]))
));
));
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xF
FCCFFFF
),
desiredSize:
new
Size
(
30.0
,
40.0
)));
subrow
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0x7
FCCFFFF
),
desiredSize:
new
Size
(
30.0
,
40.0
)));
row
.
a
lignItems
=
align
;
row
.
a
dd
(
subrow
)
;
table
.
add
(
row
);
table
.
add
(
row
);
row
.
parentData
.
flex
=
1
;
row
.
parentData
.
flex
=
1
;
}
}
addRow
(
FlexAlignItems
.
start
);
addRow
(
FlexAlignItems
.
end
);
addRow
(
FlexAlignItems
.
center
);
addRow
(
FlexAlignItems
.
stretch
);
addRow
(
FlexAlignItems
.
baseline
);
RenderDecoratedBox
root
=
new
RenderDecoratedBox
(
RenderDecoratedBox
root
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)),
child:
new
RenderPadding
(
child:
table
,
padding:
new
EdgeDims
.
symmetric
(
vertical:
50.0
))
child:
new
RenderPadding
(
child:
table
,
padding:
new
EdgeDims
.
symmetric
(
vertical:
50.0
))
...
...
sky/sdk/lib/rendering/box.dart
浏览文件 @
d7d625b2
...
@@ -1662,7 +1662,7 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare
...
@@ -1662,7 +1662,7 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare
assert
(
child
.
parentData
is
ParentDataType
);
assert
(
child
.
parentData
is
ParentDataType
);
double
candidate
=
child
.
getDistanceToActualBaseline
(
baseline
);
double
candidate
=
child
.
getDistanceToActualBaseline
(
baseline
);
if
(
candidate
!=
null
)
{
if
(
candidate
!=
null
)
{
candidate
+=
child
.
parentData
.
position
.
x
;
candidate
+=
child
.
parentData
.
position
.
y
;
if
(
result
!=
null
)
if
(
result
!=
null
)
result
=
math
.
min
(
result
,
candidate
);
result
=
math
.
min
(
result
,
candidate
);
else
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录