Fix #122110: Remove long text selection flickering

Fix flickering when selecting long (scrolled) text from the left.

Pull Request: https://projects.blender.org/blender/blender/pulls/122123
This commit is contained in:
Lalit Shankar Chowdhury 2024-05-23 01:41:56 +02:00 committed by Harley Acheson
parent 7be5802187
commit b561771f50

@ -1948,8 +1948,8 @@ static void widget_draw_text(const uiFontStyle *fstyle,
const auto boxes = BLF_str_selection_boxes(fstyle->uifont_id,
drawstr + but->ofs,
strlen(drawstr),
but->selsta - but->ofs,
but->selend - but->selsta);
(but->selsta >= but->ofs) ? but->selsta - but->ofs : 0,
but->selend - std::max(but->ofs, but->selsta));
for (auto bounds : boxes) {
immRecti(pos,
rect->xmin + bounds.min,