Skip to content

Commit

Permalink
Not drawing metarelation with missing relations
Browse files Browse the repository at this point in the history
  • Loading branch information
Petter Ericson committed Mar 17, 2021
1 parent a1df7d1 commit 5904c35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ function draw_metarelation_arg(draw_context, mei_graph, g_elem) {
var type = relation_type(g_elem);
var targets = relation_allnodes_arg(mei_graph, g_elem).map(
(e) => svg_find_from_mei_elem(svg_elem, id_prefix, e));
if(targets.indexOf(null) != -1){
console.log("Missing relation, not drawing metarelation");
return [];
}

var coords = targets.map(get_metarelation_target);
var x = average(coords.map((e) => e[0]));
// Above
Expand Down

0 comments on commit 5904c35

Please sign in to comment.