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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/exported/WebSnapPointList.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebSnapPointList.cpp b/third_party/WebKit/Source/platform/exported/WebSnapPointList.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..34aaa169ca476eda5da8edbd6f89017fb13d7162
--- /dev/null
+++ b/third_party/WebKit/Source/platform/exported/WebSnapPointList.cpp
@@ -0,0 +1,27 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "public/platform/WebSnapPointList.h"
+
+#include <algorithm>
+
+namespace blink {
+
+void WebSnapPointList::AddSnapPoint(double offset,
+ bool must_snap,
+ bool is_start,
+ bool is_end,
+ SnapOrientation orientation) {
+ WebSnapPoint point(offset, must_snap, is_start, is_end);
+ if (orientation == kSnapX)
+ horizontal_.push_back(point);
+ else
+ vertical_.push_back(point);
+}
+
+void WebSnapPointList::Sort() {
+ std::sort(horizontal_.begin(), horizontal_.end());
+ std::sort(vertical_.begin(), vertical_.end());
+}
+
+} // namespace blink
« 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