| 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 '../fn.dart'; | 5 import '../fn.dart'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:sky' as sky; | 7 import 'dart:sky' as sky; |
| 8 import 'ink_splash.dart'; | 8 import 'ink_splash.dart'; |
| 9 import 'scrollable.dart'; | 9 import 'scrollable.dart'; |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 return new EventListenerNode( | 38 return new EventListenerNode( |
| 39 new Container( | 39 new Container( |
| 40 style: _containmentStyleHack, | 40 style: _containmentStyleHack, |
| 41 inlineStyle: inlineStyle, | 41 inlineStyle: inlineStyle, |
| 42 children: childrenIncludingSplashes), | 42 children: childrenIncludingSplashes), |
| 43 onGestureTapDown: _startSplash, | 43 onGestureTapDown: _startSplash, |
| 44 onGestureTap: _confirmSplash | 44 onGestureTap: _confirmSplash |
| 45 ); | 45 ); |
| 46 } | 46 } |
| 47 | 47 |
| 48 sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingCli
entRect(); | |
| 49 | |
| 50 void _startSplash(sky.GestureEvent event) { | 48 void _startSplash(sky.GestureEvent event) { |
| 51 setState(() { | 49 setState(() { |
| 52 if (_splashes == null) | 50 if (_splashes == null) |
| 53 _splashes = new LinkedHashSet<SplashController>(); | 51 _splashes = new LinkedHashSet<SplashController>(); |
| 54 var splash; | 52 var splash; |
| 55 splash = new SplashController(_getBoundingRect(), event.x, event.y, | 53 var root = getRoot(); |
| 54 splash = new SplashController(root.rect, event.x, event.y, |
| 56 pointer: event.primaryPointer, | 55 pointer: event.primaryPointer, |
| 57 onDone: () { _splashDone(splash); }); | 56 onDone: () { _splashDone(splash); }); |
| 58 _splashes.add(splash); | 57 _splashes.add(splash); |
| 59 UINode node = parent; | 58 UINode node = parent; |
| 60 while (node != null) { | 59 while (node != null) { |
| 61 if (node is Scrollable) | 60 if (node is Scrollable) |
| 62 node.registerScrollClient(this); | 61 node.registerScrollClient(this); |
| 63 node = node.parent; | 62 node = node.parent; |
| 64 } | 63 } |
| 65 }); | 64 }); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 void _splashDone(SplashController splash) { | 107 void _splashDone(SplashController splash) { |
| 109 if (_splashes == null) | 108 if (_splashes == null) |
| 110 return; | 109 return; |
| 111 setState(() { | 110 setState(() { |
| 112 _splashes.remove(splash); | 111 _splashes.remove(splash); |
| 113 if (_splashes.length == 0) | 112 if (_splashes.length == 0) |
| 114 _splashes = null; | 113 _splashes = null; |
| 115 }); | 114 }); |
| 116 } | 115 } |
| 117 } | 116 } |
| OLD | NEW |