summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-07-25 17:35:40 +0200
committerGitHub <noreply@github.com>2016-07-25 17:35:40 +0200
commit682b4af017987725318d83541fec25a43edead84 (patch)
tree204e999041a0eda480fc1188ee40e8ff9724a1e6
parentMerge pull request #1973 from linkmauve/no-sse4.1 (diff)
parentProtection against a resize of size 0 (diff)
downloadyuzu-682b4af017987725318d83541fec25a43edead84.tar
yuzu-682b4af017987725318d83541fec25a43edead84.tar.gz
yuzu-682b4af017987725318d83541fec25a43edead84.tar.bz2
yuzu-682b4af017987725318d83541fec25a43edead84.tar.lz
yuzu-682b4af017987725318d83541fec25a43edead84.tar.xz
yuzu-682b4af017987725318d83541fec25a43edead84.tar.zst
yuzu-682b4af017987725318d83541fec25a43edead84.zip
-rw-r--r--src/common/emu_window.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/emu_window.cpp b/src/common/emu_window.cpp
index 08270dd88..fd728c109 100644
--- a/src/common/emu_window.cpp
+++ b/src/common/emu_window.cpp
@@ -51,7 +51,6 @@ static bool IsWithinTouchscreen(const EmuWindow::FramebufferLayout& layout, unsi
}
std::tuple<unsigned,unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsigned new_y) {
-
new_x = std::max(new_x, framebuffer_layout.bottom_screen.left);
new_x = std::min(new_x, framebuffer_layout.bottom_screen.right-1);
@@ -92,9 +91,9 @@ void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y) {
}
EmuWindow::FramebufferLayout EmuWindow::FramebufferLayout::DefaultScreenLayout(unsigned width, unsigned height) {
-
- ASSERT(width > 0);
- ASSERT(height > 0);
+ // When hiding the widget, the function receives a size of 0
+ if (width == 0) width = 1;
+ if (height == 0) height = 1;
EmuWindow::FramebufferLayout res = { width, height, {}, {} };