Skip to content

Commit

Permalink
Fixed bug in ui::Window scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
nadult committed Jan 15, 2025
1 parent a3d64f2 commit 01c83f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/io/main_menu_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include "ui/file_dialog.h"
#include "ui/image_button.h"

#ifdef MessageBox // Yea.. TODO: remove windows.h from includes
#undef MessageBox
#endif

#include <fwk/io/file_system.h>
#include <fwk/vulkan/vulkan_window.h>

Expand Down
5 changes: 2 additions & 3 deletions src/ui/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ void Window::setRect(const IRect &rect) {

void Window::setInnerRect(const IRect &rect) {
int2 isize = rect.size();
m_inner_rect = {vmax(vmin(rect.min(), {0, 0}), vmin(-isize + m_rect.size(), {0, 0})),
m_inner_rect.min() + isize};
m_inner_rect.setMin(vmax(vmin(rect.min(), {0, 0}), vmin(-isize + m_rect.size(), {0, 0})));
m_inner_rect.setMax(m_inner_rect.min() + isize);
m_has_inner_rect = isize.x > m_rect.width() || isize.y > m_rect.height();
}

Expand Down Expand Up @@ -301,5 +301,4 @@ void Window::updateRects() {
for(int n = 0; n < (int)m_children.size(); n++)
m_children[n]->updateRects();
}

}

0 comments on commit 01c83f7

Please sign in to comment.