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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebSnapPointList.cpp

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format Created 3 years, 6 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 #include "public/platform/WebSnapPointList.h"
5
6 #include <algorithm>
7
8 namespace blink {
9
10 void WebSnapPointList::AddSnapPoint(double offset,
11 bool must_snap,
12 bool is_start,
13 bool is_end,
14 SnapOrientation orientation) {
15 WebSnapPoint point(offset, must_snap, is_start, is_end);
16 if (orientation == kSnapX)
17 horizontal_.push_back(point);
18 else
19 vertical_.push_back(point);
20 }
21
22 void WebSnapPointList::Sort() {
23 std::sort(horizontal_.begin(), horizontal_.end());
24 std::sort(vertical_.begin(), vertical_.end());
25 }
26
27 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698