Skip to content

Commit

Permalink
Fixed bug export SVG main view doesn't contain a viewbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzhuca committed Jan 27, 2024
1 parent b307a48 commit bf718f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/middleware/export_svg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export_svg_middleware(Store<AppState> 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');
}
Expand Down Expand Up @@ -245,7 +245,7 @@ SvgSvgElement get_cloned_svg_element_with_style(List<Element> 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;
}
Expand Down

0 comments on commit bf718f2

Please sign in to comment.