Label text stages in the chain list with their words

Effect::label(values) names a stage in a list, defaulting to the title;
the text effect answers "Text (words)", and the chain rows are renamed
in place as params change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Si
2026-09-23 21:37:26 +02:00
co-authored by Claude Opus 5.5
parent 134c575727
commit 5292c101db
6 changed files with 47 additions and 2 deletions
+7
View File
@@ -857,6 +857,13 @@ int main() {
// Like blur and overlay it needs no sources of its own, and the same
// settings render the same bytes twice over.
check(!TextEffect().needsSources(), "text can lead a chain");
// A text stage is named after its words, on one line.
check(TextEffect().label({{"text", std::string(" Two\nlines ")}}) == "Text (Two lines)",
"a text stage is labelled with its words");
check(TextEffect().label({{"text", std::string(" \n")}}) == "Text",
"a text stage with no words is labelled with the title alone");
check(effectByName("blur")->label({}) == "Blur", "other effects are labelled with their title");
const auto alone = renderText({}, 200, 120, plain);
check(alone.width() == 200 && countRed(alone, 0, 0, 200, 120) > 0,
"without sources it draws on an empty canvas");