From eb0e866c52a8fc87849efa144d12f6475e003449 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Wed, 17 Aug 2022 22:05:54 +0200 Subject: [PATCH] tests: SvgAnalyzer: GraphvizEdge add retrieval of center position --- tests/graphviz_edge.cpp | 2 ++ tests/graphviz_edge.h | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/graphviz_edge.cpp b/tests/graphviz_edge.cpp index ca33ecf0e..332b2504b 100644 --- a/tests/graphviz_edge.cpp +++ b/tests/graphviz_edge.cpp @@ -10,3 +10,5 @@ const SVG::SVGElement &GraphvizEdge::svg_g_element() const { } SVG::SVGRect GraphvizEdge::bbox() const { return m_svg_g_element.bbox(); } + +SVG::SVGPoint GraphvizEdge::center() const { return bbox().center(); } diff --git a/tests/graphviz_edge.h b/tests/graphviz_edge.h index 5e774aa81..87a810e73 100644 --- a/tests/graphviz_edge.h +++ b/tests/graphviz_edge.h @@ -16,6 +16,7 @@ public: explicit GraphvizEdge(SVG::SVGElement &svg_g_element); SVG::SVGRect bbox() const; + SVG::SVGPoint center() const; std::string_view edgeop() const; /// Return a non-mutable reference to the SVG `g` element corresponding to the /// edge -- 2.40.0