Browse Source

Merge pull request #2170 from lioncash/emu-window

core/frontend/emu_window: Make ClipToTouchScreen a const member function
pull/15/merge
bunnei 7 years ago
committed by GitHub
parent
commit
14430f7df9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/frontend/emu_window.cpp
  2. 2
      src/core/frontend/emu_window.h

2
src/core/frontend/emu_window.cpp

@ -67,7 +67,7 @@ static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigne
framebuffer_x >= layout.screen.left && framebuffer_x < layout.screen.right);
}
std::tuple<unsigned, unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsigned new_y) {
std::tuple<unsigned, unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsigned new_y) const {
new_x = std::max(new_x, framebuffer_layout.screen.left);
new_x = std::min(new_x, framebuffer_layout.screen.right - 1);

2
src/core/frontend/emu_window.h

@ -166,7 +166,7 @@ private:
/**
* Clip the provided coordinates to be inside the touchscreen area.
*/
std::tuple<unsigned, unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y);
std::tuple<unsigned, unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y) const;
};
} // namespace Core::Frontend
Loading…
Cancel
Save