@@ -28434,12 +28434,23 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
2843428434 row_height, font, background_color, text_color, nk_false);
2843528435 }
2843628436 if (edit->select_start != edit->select_end) {
28437+ int glyph_len;
28438+ nk_rune unicode;
28439+
2843728440 /* draw selected text */
2843828441 NK_ASSERT(select_begin_ptr);
2843928442 if (!select_end_ptr) {
2844028443 const char *begin = nk_str_get_const(&edit->string);
2844128444 select_end_ptr = begin + nk_str_len_char(&edit->string);
2844228445 }
28446+
28447+ glyph_len = nk_utf_decode(select_begin_ptr, &unicode, (int)(select_end_ptr - select_begin_ptr));
28448+ /* In this case, we set the cursor to the first selected character */
28449+ kb_text_cursor = nk_rect(
28450+ area.x + selection_offset_start.x - edit->scrollbar.x,
28451+ area.y + selection_offset_start.y - edit->scrollbar.y,
28452+ font->width(font->userdata, font->height, select_begin_ptr, glyph_len), row_height);
28453+
2844328454 nk_edit_draw_text(out, style,
2844428455 area.x - edit->scrollbar.x,
2844528456 area.y + selection_offset_start.y - edit->scrollbar.y,
@@ -30775,7 +30786,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
3077530786/// - 2025/04/06 (4.12.7) - Fix text input navigation and mouse scrolling
3077630787/// - 2025/03/29 (4.12.6) - Fix unitialized data in nk_input_char
3077730788/// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code
30778- /// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of ‘ char[1]’
30789+ /// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of � char[1]�
3077930790/// - 2024/12/11 (4.12.3) - Fix border color for property widgets
3078030791/// - 2024/11/20 (4.12.2) - Fix int/float type conversion warnings in `nk_roundf`
3078130792/// - 2024/03/07 (4.12.1) - Fix bitwise operations warnings in C++20
0 commit comments