Explorar o código

stb_textedit: better support for keying while holding mouse drag button

ocornut %!s(int64=9) %!d(string=hai) anos
pai
achega
9dc860b7cc
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      stb_textedit.h

+ 2 - 0
stb_textedit.h

@@ -451,6 +451,8 @@ static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *stat
 static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y)
 {
    int p = stb_text_locate_coord(str, x, y);
+   if (state->select_start == state->select_end)
+      state->select_start = state->cursor;
    state->cursor = state->select_end = p;
 }