From 643f23f4ed33abf84acc8e9f32b48ad294c03be3 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Wed, 22 May 2024 19:40:37 +0200 Subject: [PATCH] Fix #122047: Correct text selection when text is scrolled Correct calculation of start of visual string and position of the selection start when the text is scrolled (showing a subset of the text) within an input box. Pull Request: https://projects.blender.org/blender/blender/pulls/122110 --- source/blender/editors/interface/interface_widgets.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/interface/interface_widgets.cc b/source/blender/editors/interface/interface_widgets.cc index 9a40b922cf6..6a820230d19 100644 --- a/source/blender/editors/interface/interface_widgets.cc +++ b/source/blender/editors/interface/interface_widgets.cc @@ -1946,9 +1946,9 @@ static void widget_draw_text(const uiFontStyle *fstyle, immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4ubv(wcol->item); const auto boxes = BLF_str_selection_boxes(fstyle->uifont_id, - drawstr, + drawstr + but->ofs, strlen(drawstr), - but->ofs + but->selsta, + but->selsta - but->ofs, but->selend - but->selsta); for (auto bounds : boxes) { immRecti(pos,