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

Side by Side Diff: services/prediction/proximity_info_factory.cc

Issue 1327033004: Allow building mojo_shell and non-graphical apps/services on a Mac (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: review feedback Created 5 years, 3 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
« no previous file with comments | « services/prediction/input_info.cc ('k') | services/prediction/touch_position_correction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <cmath> 6 #include <cmath>
7 #include <new> 7 #include <new>
8 #include <vector> 8 #include <vector>
9 9
10 #include "services/prediction/proximity_info_factory.h" 10 #include "services/prediction/proximity_info_factory.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 const int right = left + k.kwidth; 180 const int right = left + k.kwidth;
181 const int top = k.ky; 181 const int top = k.ky;
182 const int bottom = top + k.kheight; 182 const int bottom = top + k.kheight;
183 const int edge_x = x < left ? left : (x > right ? right : x); 183 const int edge_x = x < left ? left : (x > right ? right : x);
184 const int edge_y = y < top ? top : (y > bottom ? bottom : y); 184 const int edge_y = y < top ? top : (y > bottom ? bottom : y);
185 const int dx = x - edge_x; 185 const int dx = x - edge_x;
186 const int dy = y - edge_y; 186 const int dy = y - edge_y;
187 return dx * dx + dy * dy; 187 return dx * dx + dy * dy;
188 } 188 }
189 189
190 } // namespace prediction 190 } // namespace prediction
OLDNEW
« no previous file with comments | « services/prediction/input_info.cc ('k') | services/prediction/touch_position_correction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698