Index: runtime/observatory/lib/src/elements/containers/virtual_tree.dart |
diff --git a/runtime/observatory/lib/src/elements/containers/virtual_tree.dart b/runtime/observatory/lib/src/elements/containers/virtual_tree.dart |
index 78ea96b988b14c3547c31fb428b24776394e44ff..4df0dd73c55c0e30aad3f5ddd3ed4b6a0920d5bf 100644 |
--- a/runtime/observatory/lib/src/elements/containers/virtual_tree.dart |
+++ b/runtime/observatory/lib/src/elements/containers/virtual_tree.dart |
@@ -4,6 +4,7 @@ |
import 'dart:async'; |
import 'dart:html'; |
+import 'dart:math' as Math; |
import 'package:observatory/src/elements/containers/virtual_collection.dart'; |
import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
import 'package:observatory/src/elements/helpers/tag.dart'; |
@@ -13,6 +14,16 @@ typedef HtmlElement VirtualTreeCreateCallback( |
typedef void VirtualTreeUpdateCallback(HtmlElement el, dynamic item, int depth); |
typedef Iterable<dynamic> VritualTreeGetChildrenCallback(dynamic value); |
+void virtualTreeUpdateLines(SpanElement element, int n) { |
+ n = Math.max(0, n); |
+ while (element.children.length > n) { |
+ element.children.removeLast(); |
+ } |
+ while (element.children.length < n) { |
+ element.children.add(new SpanElement()); |
+ } |
+} |
+ |
class VirtualTreeElement extends HtmlElement implements Renderable { |
static const tag = |
const Tag<VirtualTreeElement>('virtual-tree', dependencies: const [ |