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

Side by Side Diff: remoting/client/viewport_geometry.cc

Issue 2843373005: [Remoting Client] DesktopViewport Implementation (Closed)
Patch Set: Fix 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/client/viewport_geometry.h"
6
7 namespace remoting {
8
9 Point ConstrainPointToBounds(const Bounds& bounds, const Point& point) {
10 Point new_point = point;
11 if (new_point.x < bounds.left) {
12 new_point.x = bounds.left;
13 } else if (new_point.x > bounds.right) {
14 new_point.x = bounds.right;
15 }
16
17 if (new_point.y < bounds.top) {
18 new_point.y = bounds.top;
19 } else if (new_point.y > bounds.bottom) {
20 new_point.y = bounds.bottom;
21 }
22 return new_point;
23 }
24
25 } // namespace remoting
OLDNEW
« remoting/client/viewport_geometry.h ('K') | « remoting/client/viewport_geometry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698