Skip to content

Commit

Permalink
WIP fixes to svg overlays for what I assume are old inkscape versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdoc committed Oct 27, 2023
1 parent 2a9a5bc commit 2fff6c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cortex/svgoverlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def gen_path(path):
verts, codes = [], []
mode, pen = None, np.array([0.,0.])

it = iter(path.get('d').split(' '))
it = iter(path.get('d').strip().split(' '))
run = True
while run:
try:
Expand Down
9 changes: 6 additions & 3 deletions cortex/webgl/resources/js/svgoverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,12 @@ var svgoverlay = (function(module) {
}

var shapes = layer.parentNode.getElementById(this.name+"_shapes");
for (var i = 0 ; i < shapes.children.length; i++) {
var name = shapes.children[i].getAttribute("inkscape:label");
this.shapes[name] = shapes.children[i];
// check if shapes is not null
if (shapes != null) {
for (var i = 0 ; i < shapes.children.length; i++) {
var name = shapes.children[i].getAttribute("inkscape:label");
this.shapes[name] = shapes.children[i];
}
}

var labels = layer.parentNode.getElementById(this.name+"_labels");
Expand Down

0 comments on commit 2fff6c6

Please sign in to comment.