Skip to content

Commit eb02faf

Browse files
Fix: Ensure bottom_radius is float in transition component
1 parent d3bc8e7 commit eb02faf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

rocketserializer/components/transition.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ def search_transitions(bs, elements, ork):
6868

6969
if transition_ork is not None:
7070
top_radius = float(transition_ork.getForeRadius())
71+
bottom_radius = float(transition_ork.getAftRadius())
7172
else:
7273
logger.warning(
73-
"Could not find Java transition for '%s', using foreradius from XML.",
74+
"Could not find Java transition for '%s', using radii from XML.",
7475
label,
7576
)
7677
fore_tag = transition.find("foreradius")
7778
fore_text = fore_tag.text if fore_tag else "0"
7879
top_radius = 0.0 if "auto" in fore_text else float(fore_text)
7980

80-
bottom_radius = (
81-
transition.find("aftradius").text
82-
if "auto" in transition.find("aftradius").text
83-
else float(transition.find("aftradius").text)
84-
)
81+
aft_tag = transition.find("aftradius")
82+
aft_text = aft_tag.text if aft_tag else "0"
83+
bottom_radius = 0.0 if "auto" in aft_text else float(aft_text)
84+
8585
length = float(transition.find("length").text)
8686
logger.info("Collected the dimensions of the transition number %d", idx)
8787

0 commit comments

Comments
 (0)