OLD | NEW |
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 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <math.h> | 9 #include <math.h> |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 DoubleSize::DoubleSize(const LayoutSize& size) | 13 DoubleSize::DoubleSize(const LayoutSize& size) |
14 : m_width(size.width().toDouble()) | 14 : m_width(size.width().toDouble()) |
15 , m_height(size.height().toDouble()) | 15 , m_height(size.height().toDouble()) |
16 { | 16 { |
17 } | 17 } |
18 | 18 |
19 bool DoubleSize::isZero() const | 19 bool DoubleSize::isZero() const |
20 { | 20 { |
21 return fabs(m_width) < std::numeric_limits<double>::epsilon() && fabs(m_heig
ht) < std::numeric_limits<double>::epsilon(); | 21 return fabs(m_width) < std::numeric_limits<double>::epsilon() && fabs(m_heig
ht) < std::numeric_limits<double>::epsilon(); |
22 } | 22 } |
23 | 23 |
24 } | 24 } // namespace blink |
OLD | NEW |