Skip to content

Commit

Permalink
gui/ime: Fix IME crash when backspace button is pressed when the inpu…
Browse files Browse the repository at this point in the history
…t box is empty (Vita3K#3405)

Co-authored-by: Dicot0721 <[email protected]>
  • Loading branch information
Dicot0721 and Dicot0721 authored Oct 13, 2024
1 parent 93759d9 commit 9fb28ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vita3k/gui/src/ime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void draw_ime(Ime &ime, EmuEnvState &emuenv) {
ImGui::SetCursorPos(ImVec2(BUTTON_POS_X, key_row_pos[3] * SCALE.y));
ImGui::PushStyleColor(ImGuiCol_Button, IME_BUTTON_BG);
ImGui::PushStyleColor(ImGuiCol_Text, GUI_COLOR_TEXT);
if (ImGui::Button("Backspace", BUTTON_SIZE) || ImGui::IsKeyPressed(static_cast<ImGuiKey>(emuenv.cfg.keyboard_button_square)) && ime.edit_text.caretIndex) {
if ((ImGui::Button("Backspace", BUTTON_SIZE) || ImGui::IsKeyPressed(static_cast<ImGuiKey>(emuenv.cfg.keyboard_button_square))) && ime.edit_text.caretIndex) {
ime.str.erase(ime.edit_text.caretIndex - 1, 1);
ime.edit_text.editIndex = ime.edit_text.caretIndex;
--ime.edit_text.caretIndex;
Expand Down

0 comments on commit 9fb28ae

Please sign in to comment.