| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 void paint(PaintingCanvas canvas) { | 55 void paint(PaintingCanvas 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, _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 bool get createNewDisplayList => true; |
| 64 |
| 63 RenderInkWell({ RenderBox child }) : super(child); | 65 RenderInkWell({ RenderBox child }) : super(child); |
| 64 | 66 |
| 65 final List<InkSplash> _splashes = new List<InkSplash>(); | 67 final List<InkSplash> _splashes = new List<InkSplash>(); |
| 66 | 68 |
| 67 void handleEvent(sky.Event event, BoxHitTestEntry entry) { | 69 void handleEvent(sky.Event event, BoxHitTestEntry entry) { |
| 68 if (event is sky.GestureEvent) { | 70 if (event is sky.GestureEvent) { |
| 69 switch (event.type) { | 71 switch (event.type) { |
| 70 case 'gesturetapdown': | 72 case 'gesturetapdown': |
| 71 _startSplash(event.primaryPointer, entry.localPosition); | 73 _startSplash(event.primaryPointer, entry.localPosition); |
| 72 break; | 74 break; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 101 } | 103 } |
| 102 } | 104 } |
| 103 | 105 |
| 104 class InkWell extends OneChildRenderObjectWrapper { | 106 class InkWell extends OneChildRenderObjectWrapper { |
| 105 InkWell({ String key, Widget child }) | 107 InkWell({ String key, Widget child }) |
| 106 : super(key: key, child: child); | 108 : super(key: key, child: child); |
| 107 | 109 |
| 108 RenderInkWell get root => super.root; | 110 RenderInkWell get root => super.root; |
| 109 RenderInkWell createNode() => new RenderInkWell(); | 111 RenderInkWell createNode() => new RenderInkWell(); |
| 110 } | 112 } |
| OLD | NEW |