mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix logic in RenderPadding.
Previously, we were not adjusting the minimum width, so we ended up offsetting the child but not shrinking it, when the parent expected the child to be exactly fit to its dimensions. R=abarth@chromium.org Review URL: https://codereview.chromium.org/1155303005
This commit is contained in:
parent
557b3e1ca4
commit
d8c996994d
19
engine/src/flutter/tests/raw/box_layout-expected.txt
Normal file
19
engine/src/flutter/tests/raw/box_layout-expected.txt
Normal file
@ -0,0 +1,19 @@
|
||||
CONSOLE: unittest-suite-wait-for-done
|
||||
CONSOLE: TestView enabled
|
||||
CONSOLE:
|
||||
PAINT FOR FRAME #1 ----------------------------------------------
|
||||
1 | TestDisplayList() constructor: 800.0 x 600.0
|
||||
1 | paintChild at 0.0,0.0
|
||||
1 | | TestDisplayList() constructor: 800.0 x 600.0
|
||||
1 | | drawRect(0.0:0.0:600.0:800.0, Paint(0xff0000ff))
|
||||
1 | | paintChild at 0.0,0.0
|
||||
1 | | | TestDisplayList() constructor: 800.0 x 600.0
|
||||
1 | | | paintChild at 50.0,50.0
|
||||
1 | | | | TestDisplayList() constructor: 800.0 x 600.0
|
||||
1 | | | | drawRect(0.0:0.0:100.0:700.0, Paint(0xff00ff00))
|
||||
------------------------------------------------------------------------
|
||||
CONSOLE: PASS: padding
|
||||
CONSOLE:
|
||||
CONSOLE: All 1 tests passed.
|
||||
CONSOLE: unittest-suite-success
|
||||
DONE
|
||||
24
engine/src/flutter/tests/raw/box_layout.dart
Normal file
24
engine/src/flutter/tests/raw/box_layout.dart
Normal file
@ -0,0 +1,24 @@
|
||||
import '../resources/third_party/unittest/unittest.dart';
|
||||
import '../resources/unit.dart';
|
||||
import '../resources/display_list.dart';
|
||||
import 'dart:math' as math;
|
||||
import 'dart:sky' as sky;
|
||||
import 'package:sky/framework/app.dart';
|
||||
import 'package:sky/framework/rendering/box.dart';
|
||||
import 'package:sky/framework/rendering/block.dart';
|
||||
import 'package:sky/framework/rendering/node.dart';
|
||||
|
||||
TestApp app;
|
||||
|
||||
void main() {
|
||||
initUnit();
|
||||
|
||||
test("padding", () {
|
||||
var size = new RenderSizedBox(desiredSize: new sky.Size(double.INFINITY, 100.0));
|
||||
var inner = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: 0xFF00FF00), child: size);
|
||||
var padding = new RenderPadding(padding: new EdgeDims.all(50.0), child: inner);
|
||||
var block = new RenderBlock(children: [padding]);
|
||||
var outer = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: 0xFF0000FF), child: block);
|
||||
app = new TestApp(outer);
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user