diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 09:46:00 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 09:46:00 +0000 |
commit | 4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4 (patch) | |
tree | 8709d2a1c9b6afcff614c4d58b774cb2ba89ff31 /printing/units.cc | |
parent | fae8f2508f0927d4099fa78be85f089bae55575c (diff) | |
download | chromium_src-4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4.zip chromium_src-4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4.tar.gz chromium_src-4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4.tar.bz2 |
Create constant variables kPointsPerInch and kPixelsPerInch and conversion functions.
BUG=47277
TEST=units_unittest.cc
Review URL: http://codereview.chromium.org/2877001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/units.cc')
-rw-r--r-- | printing/units.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/printing/units.cc b/printing/units.cc index 5f543fe..976fa80 100644 --- a/printing/units.cc +++ b/printing/units.cc @@ -39,4 +39,12 @@ int ConvertHundredThousanthMeterToMilliInch(int cmm) { return ConvertUnit(cmm, 254, 100); } +int ConvertPixelsToPoint(int pixels) { + return ConvertUnit(pixels, kPixelsPerInch, kPointsPerInch); +} + +double ConvertPixelsToPointDouble(double pixels) { + return ConvertUnitDouble(pixels, kPixelsPerInch, kPointsPerInch); +} + } // namespace printing |