Chromium Code Reviews| Index: chrome/browser/resources/print_preview/print_preview_utils.js |
| diff --git a/chrome/browser/resources/print_preview/print_preview_utils.js b/chrome/browser/resources/print_preview/print_preview_utils.js |
| index 90ecd1603accb153b7e25bd4c5b976d097cdc0e0..f1257086d50ee2b3e0f693481b944db45ac91816 100644 |
| --- a/chrome/browser/resources/print_preview/print_preview_utils.js |
| +++ b/chrome/browser/resources/print_preview/print_preview_utils.js |
| @@ -206,6 +206,7 @@ function randomInteger(endPointA, endPointB) { |
| // Number of points per inch. |
| POINTS_PER_INCH = 72; |
| +POINTS_PER_MILLIMETER = 2.83464567; |
|
Evan Stade
2011/10/21 01:33:02
technically should start with var
dpapad
2011/10/21 16:12:48
Done.
|
| /** |
| * Converts |value| from inches to points. |
| @@ -224,3 +225,21 @@ function convertInchesToPoints(value) { |
| function convertPointsToInches(value) { |
| return value / POINTS_PER_INCH; |
| } |
| + |
| +/** |
| + * Converts |value| from centimeters to points. |
| + * @param {number} value The number in centimeters. |
| + * @return {number} |value| in points. |
| + */ |
| +function convertMillimetersToPoints(value) { |
|
Evan Stade
2011/10/21 01:33:02
I would not create these functions. Just multiply
dpapad
2011/10/21 16:12:48
I prefer to keep them (along with convertInchesToP
|
| + return value * POINTS_PER_MILLIMETER; |
| +} |
| + |
| +/** |
| + * Converts |value| from points to centimeters.. |
|
Evan Stade
2011/10/21 01:33:02
not cm
dpapad
2011/10/21 16:12:48
Done.
|
| + * @param {number} value The number in points. |
| + * @return {number} |value| in centimeters. |
| + */ |
| +function convertPointsToMillimeters(value) { |
| + return value / POINTS_PER_MILLIMETER; |
| +} |