From 688c27f3ee881d95209e8c6cf8056441fd73f287 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Sep 2025 16:41:54 +0000 Subject: [PATCH] Fix Draw method to use new architecture - addresses @tig's feedback Co-authored-by: tig <585482+tig@users.noreply.github.com> --- Terminal.Gui/Text/TextFormatter.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Terminal.Gui/Text/TextFormatter.cs b/Terminal.Gui/Text/TextFormatter.cs index c9d1878e5..77876fbe5 100644 --- a/Terminal.Gui/Text/TextFormatter.cs +++ b/Terminal.Gui/Text/TextFormatter.cs @@ -154,18 +154,18 @@ public class TextFormatter IConsoleDriver? driver = null ) { - // With this check, we protect against subclasses with overrides of Text (like Button) - if (string.IsNullOrEmpty (Text)) - { - return; - } + // Use the new architecture - this addresses @tig's feedback that the new architecture wasn't being used + // Sync properties with the new formatter + SyncFormatterProperties(); + + // Format the text using the new architecture + FormattedText formattedText = _formatter.Format(); + + // Render using the new renderer + _renderer.Draw(formattedText, screen, normalColor, hotColor, FillRemaining, maximum, driver); + } - if (driver is null) - { - driver = Application.Driver; - } - - driver?.SetAttribute (normalColor); + /// List linesFormatted = GetLines ();