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

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

Issue 2195903002: Add Double{Size, Point, Rect} pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geometryPrettyPrinters2
Patch Set: Remove unnecessary String casts Created 4 years, 3 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/DoublePoint.h" 5 #include "platform/geometry/DoublePoint.h"
6 #include "platform/geometry/FloatSize.h" 6 #include "platform/geometry/FloatSize.h"
7 #include "platform/geometry/LayoutPoint.h" 7 #include "platform/geometry/LayoutPoint.h"
8
9 #include "wtf/text/WTFString.h" 8 #include "wtf/text/WTFString.h"
10 9
11 namespace blink { 10 namespace blink {
12 11
13 DoublePoint::DoublePoint(const LayoutPoint& p) 12 DoublePoint::DoublePoint(const LayoutPoint& p)
14 : m_x(p.x().toDouble()) 13 : m_x(p.x().toDouble())
15 , m_y(p.y().toDouble()) 14 , m_y(p.y().toDouble())
16 { 15 {
17 } 16 }
18 17
19 DoublePoint::DoublePoint(const FloatSize& size) 18 DoublePoint::DoublePoint(const FloatSize& size)
20 : m_x(size.width()), m_y(size.height()) 19 : m_x(size.width()), m_y(size.height())
21 { 20 {
22 } 21 }
23 22
24 #ifndef NDEBUG
25 String DoublePoint::toString() const 23 String DoublePoint::toString() const
26 { 24 {
27 return String::format("%f,%f", x(), y()); 25 return String::format("%lg,%lg", x(), y());
28 } 26 }
29 #endif
30 27
31 } // namespace blink 28 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/DoublePoint.h ('k') | third_party/WebKit/Source/platform/geometry/DoubleRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698