Skip to content

Commit

Permalink
fix overflow in input window (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez authored Nov 7, 2023
1 parent 3da33bd commit c75ff36
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/window/gui/InputEditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,17 @@ void InputEditorWindow::DrawControllerSchema() {
DrawButton("Left", BTN_CLEFT, mCurrentPort, &mBtnReading);
DrawButton("Right", BTN_CRIGHT, mCurrentPort, &mBtnReading);
ImGui::Dummy(ImVec2(0, 5));
EndGroupPanel(0.0f);

ImGui::SetCursorPosX(cursor.x);
#ifdef __SWITCH__
EndGroupPanel(isKeyboard ? 53.0f : 122.0f);
ImGui::SetCursorPosY(cursor.y + 167);
#elif defined(__WIIU__)
ImGui::SetCursorPosY(cursor.y + 120 * 2);
#else
EndGroupPanel(isKeyboard ? 53.0f : 94.0f);
ImGui::SetCursorPosY(cursor.y + 120);
#endif

ImGui::SetCursorPosX(cursor.x);
ImGui::SameLine();

BeginGroupPanel("Options", ImVec2(158, 20));
float cursorX = ImGui::GetCursorPosX() + 5;
ImGui::SetCursorPosX(cursorX);
Expand Down Expand Up @@ -427,6 +429,7 @@ void InputEditorWindow::DrawControllerSchema() {
"%s", "How near in degrees to a virtual notch angle you have to be for it to snap to nearest notch");
}

ImGui::SetCursorPosX(cursorX);
if (ImGui::Checkbox("Stick Deadzones For Buttons", &profile->UseStickDeadzoneForButtons)) {
Context::GetInstance()->GetControlDeck()->SaveSettings();
}
Expand Down Expand Up @@ -455,10 +458,10 @@ void InputEditorWindow::DrawElement() {
ImVec2 maxSize = ImVec2(2200, 505);
#elif defined(__WIIU__)
ImVec2 minSize = ImVec2(641 * 2, 250 * 2);
ImVec2 maxSize = ImVec2(1200 * 2, 330 * 2);
ImVec2 maxSize = ImVec2(1200 * 2, 360 * 2);
#else
ImVec2 minSize = ImVec2(641, 250);
ImVec2 maxSize = ImVec2(1200, 330);
ImVec2 maxSize = ImVec2(1200, 360);
#endif

ImGui::SetNextWindowSizeConstraints(minSize, maxSize);
Expand Down

0 comments on commit c75ff36

Please sign in to comment.