Make BoxDecoration replaceable.

Factor out a reusable interface called Decoration from BoxDecoration.

Make all the consumers of BoxDecoration and the erstwhile BoxPainter
into consumers of Decoration.

Make a BoxPainter be something you get from a Decoration, rather than
something to which you pass a BoxDecoration.

Rename Shape to BoxShape now that it's documented specifically as
applying to boxes.

Move EdgeDims to its own file.

Move FractionalOffset up so that it's with the other helper classes in
its file rather than alone at the end.

Minor change to RenderClipOval's hit testing to avoid taking an
unnecessary square root.

Rename BoxDecorationPosition to DecorationPosition since
RenderDecoratedBox now takes any Decoration.

Implement hit testing for rounded rects.

Rename AnimatedBoxDecorationValue to AnimatedDecorationValue, and make
it support lerping across any Decoration (by deferring to the objects
involved).
This commit is contained in:
Ian Hickson
2015-12-06 15:49:23 -08:00
parent 0fe72b17f3
commit 2afa87dfcd
19 changed files with 429 additions and 339 deletions

View File

@@ -50,7 +50,7 @@ class Dot extends StatelessComponent {
height: size,
decoration: new BoxDecoration(
backgroundColor: color,
shape: Shape.circle
shape: BoxShape.circle
),
child: child
);

View File

@@ -14,7 +14,7 @@ class Circle extends StatelessComponent {
width: 50.0,
margin: margin + new EdgeDims.symmetric(horizontal: 2.0),
decoration: new BoxDecoration(
shape: Shape.circle,
shape: BoxShape.circle,
backgroundColor: const Color(0xFF00FF00)
)
);