Work on rectangle positioning

This commit is contained in:
John Whitington 2016-11-13 16:22:21 +00:00
parent 9d34594f13
commit ed9f7680ca
1 changed files with 6 additions and 0 deletions

View File

@ -3106,6 +3106,12 @@ let addrectangle
let x, y, _ = let x, y, _ =
Cpdf.calculate_position false w mediabox Cpdf.Horizontal position Cpdf.calculate_position false w mediabox Cpdf.Horizontal position
in 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 = let ops =
[ [
Pdfops.Op_q; Pdfops.Op_q;