From 2b5701214ac69222b22aac4a9588a46691c0a81e Mon Sep 17 00:00:00 2001 From: Clement Roblot Date: Thu, 31 Oct 2024 21:09:59 +0700 Subject: [PATCH] Dirty wrap around implementation --- src/ftxui/dom/text.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ftxui/dom/text.cpp b/src/ftxui/dom/text.cpp index 82b29a6..c89b360 100644 --- a/src/ftxui/dom/text.cpp +++ b/src/ftxui/dom/text.cpp @@ -42,13 +42,18 @@ class Text : public Node { continue; } screen.PixelAt(x, y).character = cell; - if(screen.PixelAt(x, y).selectable == true) { if(screen.selection_region.Contain(x, y)) { screen.PixelAt(x, y).inverted ^= true; screen.selection_text += screen.PixelAt(x, y).character; } + else if(screen.selection_region.x_min <= x && screen.selection_region.x_max <= x && + screen.selection_region.y_min <= y && screen.selection_region.y_max > y) + { + screen.PixelAt(x, y).inverted ^= true; + screen.selection_text += screen.PixelAt(x, y).character; + } } ++x;