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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/DoubleSize.cpp

Issue 2940933003: DO NOT SUBMIT results of new clang-format (Closed)
Patch Set: 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/geometry/DoubleSize.h" 5 #include "platform/geometry/DoubleSize.h"
6 #include "platform/geometry/LayoutSize.h" 6 #include "platform/geometry/LayoutSize.h"
7 #include "platform/wtf/text/WTFString.h" 7 #include "platform/wtf/text/WTFString.h"
8 8
9 #include <math.h>
9 #include <limits> 10 #include <limits>
10 #include <math.h>
11 11
12 namespace blink { 12 namespace blink {
13 13
14 DoubleSize::DoubleSize(const LayoutSize& size) 14 DoubleSize::DoubleSize(const LayoutSize& size)
15 : width_(size.Width().ToDouble()), height_(size.Height().ToDouble()) {} 15 : width_(size.Width().ToDouble()), height_(size.Height().ToDouble()) {}
16 16
17 bool DoubleSize::IsZero() const { 17 bool DoubleSize::IsZero() const {
18 return fabs(width_) < std::numeric_limits<double>::epsilon() && 18 return fabs(width_) < std::numeric_limits<double>::epsilon() &&
19 fabs(height_) < std::numeric_limits<double>::epsilon(); 19 fabs(height_) < std::numeric_limits<double>::epsilon();
20 } 20 }
21 21
22 String DoubleSize::ToString() const { 22 String DoubleSize::ToString() const {
23 return String::Format("%lgx%lg", Width(), Height()); 23 return String::Format("%lgx%lg", Width(), Height());
24 } 24 }
25 25
26 } // namespace blink 26 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698