From ed9f7680ca98879fc1b477ab6a4a6437abe42845 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Sun, 13 Nov 2016 16:22:21 +0000 Subject: [PATCH] Work on rectangle positioning --- cpdfcommand.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index db3ef65..daf5a2c 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3106,6 +3106,12 @@ let addrectangle let x, y, _ = Cpdf.calculate_position false w mediabox Cpdf.Horizontal position in + let x, y = + match position with + Cpdf.Top _ | Cpdf.TopLeft _ | Cpdf.TopRight _ -> (x, y -. h) + | Cpdf.Centre -> (x, y -. (h /. 2.)) + | _ -> (x, y) + in let ops = [ Pdfops.Op_q;