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

Unified Diff: sky/sdk/lib/framework/layout2.dart

Issue 1153893006: Replace setBoxDecoration() with a decoration property. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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/examples/raw/simple_render_tree.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/layout2.dart
diff --git a/sky/sdk/lib/framework/layout2.dart b/sky/sdk/lib/framework/layout2.dart
index 967ea8e79fa01063af57090b1aa22fd2b3df0f7d..d31fce2c9b7d508fc28e142aa843761520d4a7ad 100644
--- a/sky/sdk/lib/framework/layout2.dart
+++ b/sky/sdk/lib/framework/layout2.dart
@@ -504,6 +504,7 @@ abstract class RenderBox extends RenderNode {
double height;
}
+// This must be immutable, because we won't notice when it changes
class BoxDecoration {
const BoxDecoration({
this.backgroundColor
@@ -513,14 +514,15 @@ class BoxDecoration {
}
class RenderDecoratedBox extends RenderBox {
- BoxDecoration _decoration;
RenderDecoratedBox(BoxDecoration decoration) : _decoration = decoration;
- void setBoxDecoration(BoxDecoration decoration) {
- if (_decoration == decoration)
+ BoxDecoration _decoration;
+ BoxDecoration get decoration => _decoration;
+ void set decoration (BoxDecoration value) {
+ if (value == _decoration)
return;
- _decoration = decoration;
+ _decoration = value;
markNeedsPaint();
}
@@ -536,6 +538,7 @@ class RenderDecoratedBox extends RenderBox {
canvas.drawRect(new sky.Rect()..setLTRB(0.0, 0.0, width, height), paint);
}
}
+
abarth-chromium 2015/05/27 16:29:39 extraneous change?
}
@@ -680,7 +683,7 @@ class RenderBlock extends RenderDecoratedBox with ContainerRenderNodeMixin<Rende
EdgeDims _padding;
EdgeDims get padding => _padding;
- void set padding(EdgeDims value) {
+ void set padding (EdgeDims value) {
abarth-chromium 2015/05/27 16:29:40 extraneous change?
assert(value != null);
if (_padding != value) {
_padding = value;
« no previous file with comments | « sky/examples/raw/simple_render_tree.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698