From bf718f25086dca9c8b3b5e299e2a0af26e5b36e4 Mon Sep 17 00:00:00 2001 From: RayBipse Date: Sat, 27 Jan 2024 14:12:07 -0800 Subject: [PATCH] Fixed bug export SVG main view doesn't contain a viewbox --- lib/src/middleware/export_svg.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/middleware/export_svg.dart b/lib/src/middleware/export_svg.dart index a5607fddb..77bd4543a 100644 --- a/lib/src/middleware/export_svg.dart +++ b/lib/src/middleware/export_svg.dart @@ -54,7 +54,7 @@ export_svg_middleware(Store store, dynamic action, NextDispatcher next } } else { if (store.state.ui_state.export_svg_text_separately) { - elt = make_portable(clone_and_apply_style(elt)); + elt = get_cloned_svg_element_with_style([elt], store.state.ui_state.export_svg_text_separately); } _export_from_element(elt, 'main'); } @@ -245,7 +245,7 @@ SvgSvgElement get_cloned_svg_element_with_style(List selected_elts, boo // have to add some padding to viewbox, for some reason bbox doesn't always fit it by a few pixels?? cloned_svg_element_with_style.setAttribute('viewBox', - '${bbox.x.floor() - 1} ${bbox.y.floor() - 1} ${bbox.width.ceil() + 3} ${bbox.height.ceil() + 3}'); + '${bbox.x.floor() - 1} ${bbox.y.floor() - 1} ${bbox.width.ceil() + 3} ${bbox.height.ceil() + 6}'); return cloned_svg_element_with_style; }