Correct the title highlighting of hbox grabing to top border

This commit is contained in:
Clement Roblot 2024-11-26 21:47:01 +07:00
parent 9a94abc31d
commit 907e146385

View File

@ -67,19 +67,16 @@ class Text : public Node {
} }
screen.PixelAt(x, y).character = cell; screen.PixelAt(x, y).character = cell;
++x; if (has_selection) {
} if((x >= selection_start_) && (x <= selection_end_)) {
if (!has_selection) {
return;
}
// Invert the selection
for(int x = selection_start_; x <= selection_end_; x++) {
screen.PixelAt(x, y).inverted = true; screen.PixelAt(x, y).inverted = true;
} }
} }
++x;
}
}
private: private:
std::string text_; std::string text_;
bool has_selection = false; bool has_selection = false;