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

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

Issue 1660863002: Force all LayoutUnit construction to be explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix multicol Created 4 years, 10 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/LayoutRect.h
diff --git a/third_party/WebKit/Source/platform/geometry/LayoutRect.h b/third_party/WebKit/Source/platform/geometry/LayoutRect.h
index 566ff1906dd498556bac8337f0fc56739f6100a7..2a6fed8d0bdfa4d8f1ef9535f8ba2f64098a5990 100644
--- a/third_party/WebKit/Source/platform/geometry/LayoutRect.h
+++ b/third_party/WebKit/Source/platform/geometry/LayoutRect.h
@@ -51,6 +51,8 @@ public:
: m_location(location), m_size(size) { }
LayoutRect(LayoutUnit x, LayoutUnit y, LayoutUnit width, LayoutUnit height)
: m_location(LayoutPoint(x, y)), m_size(LayoutSize(width, height)) { }
+ LayoutRect(int x, int y, int width, int height)
eae 2016/02/12 01:14:59 ...and here
+ : m_location(LayoutPoint(x, y)), m_size(LayoutSize(width, height)) { }
LayoutRect(const FloatPoint& location, const FloatSize& size)
: m_location(location), m_size(size) { }
LayoutRect(const DoublePoint& location, const DoubleSize& size)
@@ -97,6 +99,7 @@ public:
void moveBy(const LayoutPoint& offset) { m_location.move(offset.x(), offset.y()); }
void moveBy(const IntPoint& offset) { m_location.move(LayoutUnit(offset.x()), LayoutUnit(offset.y())); }
void move(LayoutUnit dx, LayoutUnit dy) { m_location.move(dx, dy); }
+ void move(int dx, int dy) { m_location.move(LayoutUnit(dx), LayoutUnit(dy)); }
void expand(const LayoutSize& size) { m_size += size; }
void expand(const LayoutRectOutsets& box)
@@ -112,6 +115,7 @@ public:
}
void contract(const LayoutSize& size) { m_size -= size; }
void contract(LayoutUnit dw, LayoutUnit dh) { m_size.expand(-dw, -dh); }
+ void contract(int dw, int dh) { m_size.expand(-dw, -dh); }
void contractEdges(LayoutUnit top, LayoutUnit right, LayoutUnit bottom, LayoutUnit left)
{
m_location.move(left, top);
@@ -174,6 +178,7 @@ public:
m_size.setHeight(m_size.height() + dy + dy);
}
void inflate(LayoutUnit d) { inflateX(d); inflateY(d); }
+ void inflate(int d) { inflate(LayoutUnit(d)); }
void scale(float s);
void scale(float xAxisScale, float yAxisScale);

Powered by Google App Engine
This is Rietveld 408576698