Skip to content
Snippets Groups Projects
Commit 46b3209a authored by Lioncash's avatar Lioncash
Browse files

core/frontend/emu_window: Make ClipToTouchScreen a const member function

This member function doesn't modify instance state, so it can have the
const specifier applied to it.
parent 10d1d583
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigne ...@@ -67,7 +67,7 @@ static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigne
framebuffer_x >= layout.screen.left && framebuffer_x < layout.screen.right); 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::max(new_x, framebuffer_layout.screen.left);
new_x = std::min(new_x, framebuffer_layout.screen.right - 1); new_x = std::min(new_x, framebuffer_layout.screen.right - 1);
......
...@@ -166,7 +166,7 @@ private: ...@@ -166,7 +166,7 @@ private:
/** /**
* Clip the provided coordinates to be inside the touchscreen area. * 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 } // namespace Core::Frontend
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment