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

Unified Diff: third_party/WebKit/Source/platform/LayoutUnit.h

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO 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/LayoutUnit.h
diff --git a/third_party/WebKit/Source/platform/LayoutUnit.h b/third_party/WebKit/Source/platform/LayoutUnit.h
index 6dc55022c396d84018b473653d709d7886c6ea4c..ddae437f424dfc4a51a650c82b0c997624a37062 100644
--- a/third_party/WebKit/Source/platform/LayoutUnit.h
+++ b/third_party/WebKit/Source/platform/LayoutUnit.h
@@ -158,11 +158,16 @@ public:
return m_value >> kLayoutUnitFractionalBits;
}
- LayoutUnit clampToZero() const
+ LayoutUnit clampNegativeToZero() const
{
return std::max(*this, LayoutUnit());
}
+ LayoutUnit clampPositiveToZero() const
+ {
+ return std::min(*this, LayoutUnit());
+ }
+
LayoutUnit fraction() const
{
// Add the fraction to the size (as opposed to the full location) to avoid overflows.
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInfoTest.cpp ('k') | third_party/WebKit/Source/platform/geometry/LayoutRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698