Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/windows/title_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ def txtLine_changed(self, txtWidget):

# Update text values in the SVG
for i, node in enumerate(self.tspan_nodes):
if len(node.childNodes) > 0 and i <= (len(text_list) - 1):
if i <= (len(text_list) - 1):
new_text_node = self.xmldoc.createTextNode(text_list[i])
old_text_node = node.childNodes[0]
node.removeChild(old_text_node)
if len(node.childNodes) > 0:
old_text_node = node.childNodes[0]
node.removeChild(old_text_node)
# add new text node
node.appendChild(new_text_node)

Expand Down Expand Up @@ -409,8 +410,9 @@ def load_svg_template(self, filename_field=None):
title_text = []
for i, node in enumerate(self.tspan_nodes):
if len(node.childNodes) < 1:
continue
text = node.childNodes[0].data
text = ""
else:
text = node.childNodes[0].data
title_text.append(text)

# Create Label
Expand Down