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

Side by Side Diff: sky/sdk/lib/widgets/ink_well.dart

Issue 1214833004: Split Size into Size and Offset. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/widgets/basic.dart ('k') | sky/sdk/lib/widgets/radio.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 import '../animation/animated_value.dart'; 8 import '../animation/animated_value.dart';
9 import '../animation/curves.dart'; 9 import '../animation/curves.dart';
10 import '../rendering/box.dart'; 10 import '../rendering/box.dart';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void _handleRadiusChange() { 49 void _handleRadiusChange() {
50 if (_radius.value == _targetRadius) 50 if (_radius.value == _targetRadius)
51 well._splashes.remove(this); 51 well._splashes.remove(this);
52 well.markNeedsPaint(); 52 well.markNeedsPaint();
53 } 53 }
54 54
55 void paint(RenderCanvas canvas) { 55 void paint(RenderCanvas canvas) {
56 int opacity = (_kSplashInitialOpacity * (1.0 - (_radius.value / _targetRadiu s))).floor(); 56 int opacity = (_kSplashInitialOpacity * (1.0 - (_radius.value / _targetRadiu s))).floor();
57 sky.Paint paint = new sky.Paint()..color = new sky.Color(opacity << 24); 57 sky.Paint paint = new sky.Paint()..color = new sky.Color(opacity << 24);
58 canvas.drawCircle(position.x, position.y, _radius.value, paint); 58 canvas.drawCircle(position, _radius.value, paint);
59 } 59 }
60 } 60 }
61 61
62 class RenderInkWell extends RenderProxyBox { 62 class RenderInkWell extends RenderProxyBox {
63 RenderInkWell({ RenderBox child }) : super(child); 63 RenderInkWell({ RenderBox child }) : super(child);
64 64
65 final List<InkSplash> _splashes = new List<InkSplash>(); 65 final List<InkSplash> _splashes = new List<InkSplash>();
66 66
67 void handleEvent(sky.Event event, BoxHitTestEntry entry) { 67 void handleEvent(sky.Event event, BoxHitTestEntry entry) {
68 if (event is sky.GestureEvent) { 68 if (event is sky.GestureEvent) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 } 101 }
102 102
103 class InkWell extends OneChildRenderObjectWrapper { 103 class InkWell extends OneChildRenderObjectWrapper {
104 InkWell({ String key, Widget child }) 104 InkWell({ String key, Widget child })
105 : super(key: key, child: child); 105 : super(key: key, child: child);
106 106
107 RenderInkWell get root => super.root; 107 RenderInkWell get root => super.root;
108 RenderInkWell createNode() => new RenderInkWell(); 108 RenderInkWell createNode() => new RenderInkWell();
109 } 109 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/basic.dart ('k') | sky/sdk/lib/widgets/radio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698