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

Unified Diff: Source/core/svg/SVGSVGElement.cpp

Issue 87453003: Less magic numbers in converting CSS lengths of cm/mm/pc/pt types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 40a3fa90cb68dcc9ecfe990f4640a7e992151250..61922d67de02fe87424610cbc3bb9007b53db744 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -145,14 +145,12 @@ SVGRect SVGSVGElement::viewport() const
float SVGSVGElement::pixelUnitToMillimeterX() const
{
- // 2.54 / cssPixelsPerInch gives CM.
- return (2.54f / cssPixelsPerInch) * 10.0f;
+ return 1 / cssPixelsPerMillimeter;
}
float SVGSVGElement::pixelUnitToMillimeterY() const
{
- // 2.54 / cssPixelsPerInch gives CM.
- return (2.54f / cssPixelsPerInch) * 10.0f;
+ return 1 / cssPixelsPerMillimeter;
}
float SVGSVGElement::screenPixelToMillimeterX() const
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698