Closed rayzhuca closed 6 months ago
It should work now. It was a quick fix. In export_svg_middleware
, there is an if statement. One branch is for ExportSvg
and another is CopySelectedStandsToClipboardImage
. I just had to call get_selected_base_pairs
in both branches.
The new commit renamed get_selected_strands
and get_selected_base_pairs
to get_svg_elements_of_strands
and get_svg_elements_of_base_pairs
as well as changes to function arguments. I also removed the long one-line and refactored two pieces of repeated of code into one function called get_selected_svg_elements
.
Added export SVG support for base pair lines.
Changes
_base_pairs(bool allow_mismatches)
to_base_pairs(bool allow_mismatches, BuiltSet<Strand> selected_strands)
. Now base_pairs isthis._base_pairs(false, strands.toBuiltSet())
andselected_base_pairs(BuiltSet<Strand> selected_strands)
just calls_base_pairs
directly.base_pair-{helix-id}-{offset}
so we can identify the base pairs that is inselected_base_pairs
.List<Element> get_selected_base_pairs(Store<AppState> store)
that mirrors the behavior ofList<Element> get_selected_strands(Store<AppState> store)
so that it adds the base pair HTML elements into the exported SVG.