Skip to content

Commit 47001c7

Browse files
committed
Address comments
1 parent ff5781d commit 47001c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/gui/gui.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ static void drop_callback(GLFWwindow* window, int count, const char** paths) {
112112
s_this->magicOpen(paths[0]);
113113
}
114114

115-
static void resize_callback(GLFWwindow* window, int width, int height) {
116-
s_this->m_setupScreenSize = true;
117-
}
118-
119115
static void ShowHelpMarker(const char* desc) {
120116
ImGui::SameLine();
121117
ImGui::TextDisabled("(?)");
@@ -275,7 +271,7 @@ end)(jit.status()))
275271

276272
s_this = this;
277273
glfwSetDropCallback(m_window, drop_callback);
278-
glfwSetWindowSizeCallback(m_window, resize_callback);
274+
glfwSetWindowSizeCallback(m_window, [](GLFWwindow*, int, int) { s_this->m_setupScreenSize = true; });
279275

280276
Resources::loadIcon([this](const uint8_t* data, uint32_t size) {
281277
int x, y, comp;
@@ -561,6 +557,9 @@ void PCSX::GUI::startFrame() {
561557
int w, h;
562558

563559
glfwGetFramebufferSize(m_window, &w, &h);
560+
// Make width/height be 1 at minimum
561+
w = std::max<int>(w, 1);
562+
h = std::max<int>(h, 1);
564563
m_framebufferSize = ImVec2(w, h);
565564
m_renderSize = ImVec2(w, h);
566565
normalizeDimensions(m_renderSize, renderRatio);

0 commit comments

Comments
 (0)