Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: remoting/client/ui/desktop_viewport.cc

Issue 2897143002: [CRD iOS] Ignore touch event when the touch point is out of the canvas in direct input mode (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/ui/desktop_viewport.h ('k') | remoting/client/ui/direct_input_strategy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ui/desktop_viewport.cc
diff --git a/remoting/client/ui/desktop_viewport.cc b/remoting/client/ui/desktop_viewport.cc
index 523afbde4150c3285f5cd1c7171d6c5f8f4cde18..c150f1bb6b02f4e58ab31bbc9bf372b1852ef27a 100644
--- a/remoting/client/ui/desktop_viewport.cc
+++ b/remoting/client/ui/desktop_viewport.cc
@@ -69,6 +69,16 @@ ViewMatrix::Point DesktopViewport::GetViewportCenter() const {
{surface_size_.x / 2.f, surface_size_.y / 2.f});
}
+bool DesktopViewport::IsPointWithinDesktopBounds(
+ const ViewMatrix::Point& point) const {
+ if (!IsViewportReady()) {
+ LOG(WARNING) << "Viewport is not ready";
+ return false;
+ }
+ return point.x >= 0 && point.y >= 0 && point.x < desktop_size_.x &&
+ point.y < desktop_size_.y;
+}
+
ViewMatrix::Point DesktopViewport::ConstrainPointToDesktop(
const ViewMatrix::Point& point) const {
if (!IsViewportReady()) {
« no previous file with comments | « remoting/client/ui/desktop_viewport.h ('k') | remoting/client/ui/direct_input_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698