Skip to content

Commit 1f00278

Browse files
committed
FIX: initialize SVGGigure width/height with Unit
1 parent e217692 commit 1f00278

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

niworkflows/viz/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def compose_view(bg_svgs, fg_svgs, ref=0, out_file="report.svg"):
367367

368368

369369
def _compose_view(bg_svgs, fg_svgs, ref=0):
370+
from svgutils.compose import Unit
370371
from svgutils.transform import SVGFigure, GroupElement
371372

372373
if fg_svgs is None:
@@ -394,7 +395,7 @@ def _compose_view(bg_svgs, fg_svgs, ref=0):
394395

395396
# Compose the views panel: total size is the width of
396397
# any element (used the first here) and the sum of heights
397-
fig = SVGFigure(width, heights[:nsvgs].sum())
398+
fig = SVGFigure(Unit(f"{width}px"), Unit(f"{heights[:nsvgs].sum()}px"))
398399

399400
yoffset = 0
400401
for i, r in enumerate(roots):

0 commit comments

Comments
 (0)