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

Unified Diff: third_party/WebKit/Source/platform/geometry/LayoutPoint.h

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar tweaks! Created 4 years, 11 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/geometry/LayoutPoint.h
diff --git a/third_party/WebKit/Source/platform/geometry/LayoutPoint.h b/third_party/WebKit/Source/platform/geometry/LayoutPoint.h
index b1fcf37d4639c1ab9757850e820751be66f446a4..e6e690902cab9cd35149c43dd1e3427d6b41934f 100644
--- a/third_party/WebKit/Source/platform/geometry/LayoutPoint.h
+++ b/third_party/WebKit/Source/platform/geometry/LayoutPoint.h
@@ -44,6 +44,7 @@ class LayoutPoint {
DISALLOW_NEW();
public:
LayoutPoint() { }
+ LayoutPoint(int x, int y) : m_x(LayoutUnit(x)), m_y(LayoutUnit(y)) { }
LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { }
LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { }
explicit LayoutPoint(const FloatPoint& point) : m_x(point.x()), m_y(point.y()) { }
@@ -61,6 +62,7 @@ public:
void move(const LayoutSize& s) { move(s.width(), s.height()); }
void move(const IntSize& s) { move(s.width(), s.height()); }
void moveBy(const LayoutPoint& offset) { move(offset.x(), offset.y()); }
+ void move(int dx, int dy) { move(LayoutUnit(dx), LayoutUnit(dy)); }
void move(LayoutUnit dx, LayoutUnit dy) { m_x += dx; m_y += dy; }
void scale(float sx, float sy)
{

Powered by Google App Engine
This is Rietveld 408576698