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

Unified Diff: remoting/client/ui/direct_input_strategy.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/direct_input_strategy.h ('k') | remoting/client/ui/gesture_interpreter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ui/direct_input_strategy.cc
diff --git a/remoting/client/ui/direct_input_strategy.cc b/remoting/client/ui/direct_input_strategy.cc
index f749fe3f963df2f968d2aace87e5b36e215e54ad..d84e7754068a29cbc5d8f933e83ac9cf12a7076a 100644
--- a/remoting/client/ui/direct_input_strategy.cc
+++ b/remoting/client/ui/direct_input_strategy.cc
@@ -41,10 +41,15 @@ bool DirectInputStrategy::HandlePan(const ViewMatrix::Vector2D& translation,
return false;
}
-void DirectInputStrategy::TrackTouchInput(const ViewMatrix::Point& touch_point,
+bool DirectInputStrategy::TrackTouchInput(const ViewMatrix::Point& touch_point,
const DesktopViewport& viewport) {
- cursor_position_ =
+ ViewMatrix::Point new_position =
viewport.GetTransformation().Invert().MapPoint(touch_point);
+ if (!viewport.IsPointWithinDesktopBounds(new_position)) {
+ return false;
+ }
+ cursor_position_ = new_position;
+ return true;
}
ViewMatrix::Point DirectInputStrategy::GetCursorPosition() const {
« no previous file with comments | « remoting/client/ui/direct_input_strategy.h ('k') | remoting/client/ui/gesture_interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698