Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
184fc63f
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,发现更多精彩内容 >>
提交
184fc63f
编写于
7月 31, 2015
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #409 from abarth/stack_repaint
Stacked does not repaint when its position changes
上级
2c307a2c
77bc162f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
85 addition
and
4 deletion
+85
-4
sky/packages/sky/lib/widgets/widget.dart
sky/packages/sky/lib/widgets/widget.dart
+2
-2
sky/tests/resources/display_list.dart
sky/tests/resources/display_list.dart
+4
-2
sky/tests/widgets/stack_relayout_from_parent_data-expected.txt
...ests/widgets/stack_relayout_from_parent_data-expected.txt
+30
-0
sky/tests/widgets/stack_relayout_from_parent_data.dart
sky/tests/widgets/stack_relayout_from_parent_data.dart
+49
-0
未找到文件。
sky/packages/sky/lib/widgets/widget.dart
浏览文件 @
184fc63f
...
...
@@ -887,8 +887,8 @@ abstract class RenderObjectWrapper extends Widget {
if
(
parentData
!=
null
)
{
assert
(
root
.
parentData
!=
null
);
root
.
parentData
.
merge
(
parentData
);
// this will throw if the types aren't appropriate
if
(
parent
.
root
!=
null
)
parent
.
root
.
markNeedsLayout
();
if
(
ancestor
!=
null
&&
ancestor
.
root
!=
null
)
ancestor
.
root
.
markNeedsLayout
();
}
}
...
...
sky/tests/resources/display_list.dart
浏览文件 @
184fc63f
...
...
@@ -178,9 +178,11 @@ class TestApp extends App {
class
WidgetTester
{
TestRenderView
renderView
=
new
TestRenderView
();
Future
test
(
Function
builder
)
{
Future
test
(
Function
builder
,
{
int
frameCount:
1
})
async
{
runApp
(
new
TestApp
(
builder:
builder
),
renderViewOverride:
renderView
);
return
renderView
.
checkFrame
();
while
(--
frameCount
!=
0
)
await
renderView
.
checkFrame
();
return
await
renderView
.
checkFrame
();
}
void
endTest
()
{
...
...
sky/tests/widgets/stack_relayout_from_parent_data-expected.txt
0 → 100644
浏览文件 @
184fc63f
TestRenderView enabled
PAINT FOR FRAME #1 ----------------------------------------------
1 | TestPaintingCanvas() constructor: 800.0 x 600.0
------------------------------------------------------------------------
PAINT FOR FRAME #2 ----------------------------------------------
2 | TestPaintingCanvas() constructor: 800.0 x 600.0
2 | paintChild RenderSizeObserver at Point(0.0, 0.0)
2 | | TestPaintingCanvas() constructor: 800.0 x 600.0
2 | | paintChild RenderStack at Point(0.0, 0.0)
2 | | | TestPaintingCanvas() constructor: 800.0 x 600.0
2 | | | paintChild RenderParagraph at Point(50.0, 50.0)
2 | | | | TestPaintingCanvas() constructor: 800.0 x 600.0
2 | | | | translate(50.0, 50.0)
2 | | | | translate(-50.0, -50.0)
------------------------------------------------------------------------
PAINT FOR FRAME #3 ----------------------------------------------
3 | TestPaintingCanvas() constructor: 800.0 x 600.0
3 | paintChild RenderSizeObserver at Point(0.0, 0.0)
3 | | TestPaintingCanvas() constructor: 800.0 x 600.0
3 | | paintChild RenderStack at Point(0.0, 0.0)
3 | | | TestPaintingCanvas() constructor: 800.0 x 600.0
3 | | | paintChild RenderParagraph at Point(400.0, 300.0)
3 | | | | TestPaintingCanvas() constructor: 800.0 x 600.0
3 | | | | translate(400.0, 300.0)
3 | | | | translate(-400.0, -300.0)
------------------------------------------------------------------------
PAINTED 3 FRAMES
sky/tests/widgets/stack_relayout_from_parent_data.dart
0 → 100644
浏览文件 @
184fc63f
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:sky/widgets/basic.dart'
;
import
'../resources/display_list.dart'
;
class
ChildComponent
extends
Component
{
ChildComponent
(
this
.
size
);
final
Size
size
;
Widget
build
()
{
String
text
=
"This text should be roughly centered"
;
return
new
Positioned
(
child:
new
Text
(
text
),
top:
size
.
height
/
2.0
,
left:
size
.
width
/
2.0
);
}
}
class
ParentComponent
extends
StatefulComponent
{
Size
_size
=
new
Size
(
100.0
,
100.0
);
void
syncFields
(
ParentComponent
source
)
{
}
Widget
build
()
{
return
new
SizeObserver
(
child
:
new
Stack
([
new
ChildComponent
(
_size
)]),
callback
:
sizeCallback
);
}
void
sizeCallback
(
Size
size
)
{
setState
(()
{
_size
=
size
;
});
}
}
main
()
async
{
WidgetTester
tester
=
new
WidgetTester
();
await
tester
.
test
(()
{
return
new
ParentComponent
();
},
frameCount:
2
);
tester
.
endTest
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录