| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/DoubleRect.h" | 5 #include "platform/geometry/DoubleRect.h" |
| 6 | 6 |
| 7 #include "platform/geometry/FloatRect.h" | 7 #include "platform/geometry/FloatRect.h" |
| 8 #include "platform/geometry/IntRect.h" | 8 #include "platform/geometry/IntRect.h" |
| 9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
| 10 | |
| 11 #include "wtf/text/WTFString.h" | 10 #include "wtf/text/WTFString.h" |
| 12 | 11 |
| 13 namespace blink { | 12 namespace blink { |
| 14 | 13 |
| 15 DoubleRect::DoubleRect(const IntRect& r) : m_location(r.location()), m_size(r.si
ze()) | 14 DoubleRect::DoubleRect(const IntRect& r) : m_location(r.location()), m_size(r.si
ze()) |
| 16 { | 15 { |
| 17 } | 16 } |
| 18 | 17 |
| 19 DoubleRect::DoubleRect(const FloatRect& r) : m_location(r.location()), m_size(r.
size()) | 18 DoubleRect::DoubleRect(const FloatRect& r) : m_location(r.location()), m_size(r.
size()) |
| 20 { | 19 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 } | 47 } |
| 49 | 48 |
| 50 void DoubleRect::scale(float sx, float sy) | 49 void DoubleRect::scale(float sx, float sy) |
| 51 { | 50 { |
| 52 m_location.setX(x() * sx); | 51 m_location.setX(x() * sx); |
| 53 m_location.setY(y() * sy); | 52 m_location.setY(y() * sy); |
| 54 m_size.setWidth(width() * sx); | 53 m_size.setWidth(width() * sx); |
| 55 m_size.setHeight(height() * sy); | 54 m_size.setHeight(height() * sy); |
| 56 } | 55 } |
| 57 | 56 |
| 58 #ifndef NDEBUG | |
| 59 String DoubleRect::toString() const | 57 String DoubleRect::toString() const |
| 60 { | 58 { |
| 61 return String::format("%s %s", location().toString().ascii().data(), size().
toString().ascii().data()); | 59 return String::format("%s %s", location().toString().ascii().data(), size().
toString().ascii().data()); |
| 62 } | 60 } |
| 63 #endif | |
| 64 | 61 |
| 65 } // namespace blink | 62 } // namespace blink |
| OLD | NEW |