diff --git a/utility/crane_msg_wrappers/include/crane_msg_wrappers/crane_visualizer_wrapper.hpp b/utility/crane_msg_wrappers/include/crane_msg_wrappers/crane_visualizer_wrapper.hpp index 75aad3a80..0b2b9ff7c 100644 --- a/utility/crane_msg_wrappers/include/crane_msg_wrappers/crane_visualizer_wrapper.hpp +++ b/utility/crane_msg_wrappers/include/crane_msg_wrappers/crane_visualizer_wrapper.hpp @@ -230,6 +230,8 @@ struct SvgTextBuilder bool view_box_position = false; + std::string anchor = "start"; + SvgTextBuilder() {} std::string getSvgString() const @@ -242,7 +244,7 @@ struct SvgTextBuilder oss << "x=\"" << text_position.x() * 1000. << "\" y=\"" << text_position.y() * 1000. << "\" "; } oss << "\" fill=\"" << fill_color << "\" fill-opacity=\"" << fill_opacity << "\" font-size=\"" - << font_size << "\">" << text_string << ""; + << font_size << "\" text-anchor=\"" << anchor << "\">" << text_string << ""; return oss.str(); } @@ -282,6 +284,12 @@ struct SvgTextBuilder font_size = size; return *this; } + + SvgTextBuilder & textAnchor(const std::string & anchor) + { + this->anchor = anchor; + return *this; + } }; struct SvgPolyLineBuilder