From 9a4f8bcc7f9f801ca0f09efe392a42b6637cc797 Mon Sep 17 00:00:00 2001 From: Seb James Date: Fri, 23 Oct 2026 15:13:24 +0100 Subject: [PATCH] Adds an update function for TxtVisual --- mplot/TxtVisual.cppm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mplot/TxtVisual.cppm b/mplot/TxtVisual.cppm index c3276967..ffbfb13b 100644 --- a/mplot/TxtVisual.cppm +++ b/mplot/TxtVisual.cppm @@ -36,6 +36,12 @@ export namespace mplot this->addLabel (this->text, sm::vec{}, this->tf); } + void update (const std::string& newtext) + { + this->text = newtext; + this->reinit_with_clearTexts(); + } + std::string text; mplot::TextFeatures tf; };