]> matita.cs.unibo.it Git - helm.git/commitdiff
bugfix: proper computation of the amount of new node shown upon expand
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 20 Jul 2006 10:46:57 +0000 (10:46 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 20 Jul 2006 10:46:57 +0000 (10:46 +0000)
helm/software/components/metadata/metadataDeps.ml

index c6dcd1e9062e74eb4d2d000edea89f816ae94713..0e1dbb817c45ef39bf8de27a43d81bab315bf13c 100644 (file)
@@ -188,17 +188,18 @@ struct
           adjacency;
         neighbs.shown <- weight;
         fst (HExtlib.split_nth weight adjacency), weight
-      else  (* nodes has been expanded at least once *)
+      else begin  (* nodes has been expanded at least once *)
         let adjacency = Lazy.force neighbs.adjacency in
         let total_nodes = List.length adjacency in
         if neighbs.shown < total_nodes then begin
           (* some more children to show ... *)
           let shown_before = neighbs.shown in
           neighbs.shown <- min (neighbs.shown + fat_increment) total_nodes;
-          let new_shown = shown_before - neighbs.shown in
+          let new_shown = neighbs.shown - shown_before in
           (fst (HExtlib.split_nth new_shown (List.rev adjacency))), new_shown
         end else
           [], 0 (* all children are already shown *)
+      end
     with Not_found ->
       (*eprintf "uri not found: %s\n%!" (UriManager.string_of_uri uri);*)
       [], 0