From d5044bdaafb9e4f2e1eb017d853ee3600fa00022 Mon Sep 17 00:00:00 2001 From: badlydrawnrod Date: Sun, 10 Jul 2022 21:14:32 +0100 Subject: [PATCH] Fix #441 Canvas::DrawText() (#442) Fix for Canvas::DrawText() draws nothing if the start coordinate is out of bounds. --- src/ftxui/dom/canvas.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ftxui/dom/canvas.cpp b/src/ftxui/dom/canvas.cpp index 3179885..74fdc4a 100644 --- a/src/ftxui/dom/canvas.cpp +++ b/src/ftxui/dom/canvas.cpp @@ -802,6 +802,7 @@ void Canvas::DrawText(int x, const Stylizer& style) { for (const auto& it : Utf8ToGlyphs(value)) { if (!IsIn(x, y)) { + x += 2; continue; } Cell& cell = storage_[XY{x / 2, y / 4}];