Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Unified Diff: sky/sdk/lib/framework/rendering/box.dart

Issue 1169873003: Give the popup menu a 2px border radius (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/components2/popup_menu.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/box.dart
diff --git a/sky/sdk/lib/framework/rendering/box.dart b/sky/sdk/lib/framework/rendering/box.dart
index 7765bf034d9d9d08b1d3a84074e570b6e391495a..dae653234343de1a5159cd8a062b69226a5c3655 100644
--- a/sky/sdk/lib/framework/rendering/box.dart
+++ b/sky/sdk/lib/framework/rendering/box.dart
@@ -649,10 +649,12 @@ class BoxDecoration {
const BoxDecoration({
this.backgroundColor,
this.border,
+ this.borderRadius,
this.boxShadow
});
final Color backgroundColor;
+ final double borderRadius;
final Border border;
final List<BoxShadow> boxShadow;
@@ -662,10 +664,10 @@ class BoxDecoration {
result.add('${prefix}backgroundColor: $backgroundColor');
if (border != null)
result.add('${prefix}border: $border');
- if (boxShadow != null) {
- for (BoxShadow shadow in boxShadow)
- result.add('${prefix}boxShadow: $shadow');
- }
+ if (borderRadius != null)
+ result.add('${prefix}borderRadius: $borderRadius');
+ if (boxShadow != null)
+ result.add('${prefix}boxShadow: ${boxShadow.map((shadow) => shadow.toString())}');
if (result.isEmpty)
return '${prefix}<no decorations specified>';
return result.join('\n');
@@ -730,10 +732,17 @@ class RenderDecoratedBox extends RenderProxyBox {
assert(size.width != null);
assert(size.height != null);
- if (_decoration.backgroundColor != null || _decoration.boxShadow != null)
- canvas.drawRect(new Rect.fromLTRB(0.0, 0.0, size.width, size.height), _backgroundPaint);
+ if (_decoration.backgroundColor != null || _decoration.boxShadow != null) {
+ Rect rect = new Rect.fromLTRB(0.0, 0.0, size.width, size.height);
+ if (_decoration.borderRadius == null)
+ canvas.drawRect(rect, _backgroundPaint);
+ else
+ canvas.drawRRect(new sky.RRect()..setRectXY(rect, _decoration.borderRadius, _decoration.borderRadius), _backgroundPaint);
+ }
if (_decoration.border != null) {
+ assert(_decoration.borderRadius == null); // TODO(abarth): Implement borders with border radius.
+
assert(_decoration.border.top != null);
assert(_decoration.border.right != null);
assert(_decoration.border.bottom != null);
« no previous file with comments | « sky/sdk/lib/framework/components2/popup_menu.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698