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

Unified Diff: printing/units.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added SK_API to vector platform device skia Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: printing/units.cc
diff --git a/printing/units.cc b/printing/units.cc
index 976fa802c97e0f1a69c261be4e238214f6b7d104..84d78bba061df4c90b0872c1e0a0f70c72970c5b 100644
--- a/printing/units.cc
+++ b/printing/units.cc
@@ -5,6 +5,7 @@
#include "printing/units.h"
#include "base/logging.h"
+#include "printing/print_job_constants.h"
namespace printing {
@@ -47,4 +48,18 @@ double ConvertPixelsToPointDouble(double pixels) {
return ConvertUnitDouble(pixels, kPixelsPerInch, kPointsPerInch);
}
+double ConvertPointsToPixelDouble(double points) {
+ return ConvertUnitDouble(points, kPointsPerInch, kPixelsPerInch);
+}
+
+double GetHeaderFooterSegmentWidth(double page_width) {
+ // Interstice is left at both ends of the page as well as between
+ // each region, so 1 is added.
+ double total_interstice_width =
+ (printing::kSettingHeaderFooterHorizontalRegions + 1) *
+ printing::kSettingHeaderFooterInterstice;
+ return (page_width - total_interstice_width) /
+ printing::kSettingHeaderFooterHorizontalRegions;
+}
+
} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698