From 88b0cdefee4ca70dfec7917805ca84274614ed8d Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 7 Jun 2023 21:52:01 +0100 Subject: [PATCH] Fix up one argument -topleft etc. --- cpdfcommand.ml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 3e4c628..4068904 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -1214,7 +1214,9 @@ let settopleft n = let coord = match Cpdfcoord.parse_coordinate empty n with | (a, b) -> Cpdfposition.TopLeft (a, b) - | exception _ -> Cpdfposition.TopLeft (Cpdfcoord.parse_single_number empty n, 0.) + | exception _ -> + let x = Cpdfcoord.parse_single_number empty n in + Cpdfposition.TopLeft (x, x) in args.position <- coord; args.justification <- Cpdfaddtext.LeftJustify @@ -1223,7 +1225,9 @@ let settopright n = let coord = match Cpdfcoord.parse_coordinate empty n with | (a, b) -> Cpdfposition.TopRight (a, b) - | exception _ -> Cpdfposition.TopRight (Cpdfcoord.parse_single_number empty n, 0.) + | exception _ -> + let x = Cpdfcoord.parse_single_number empty n in + Cpdfposition.TopRight (x, x) in args.position <- coord; args.justification <- Cpdfaddtext.RightJustify @@ -1236,7 +1240,9 @@ let setbottomleft n = let coord = match Cpdfcoord.parse_coordinate empty n with | (a, b) -> Cpdfposition.BottomLeft (a, b) - | exception _ -> Cpdfposition.BottomLeft (Cpdfcoord.parse_single_number empty n, 0.) + | exception _ -> + let x = Cpdfcoord.parse_single_number empty n in + Cpdfposition.BottomLeft (x, x) in args.position <- coord; args.justification <- Cpdfaddtext.LeftJustify @@ -1249,7 +1255,9 @@ let setbottomright n = let coord = match Cpdfcoord.parse_coordinate empty n with | (a, b) -> Cpdfposition.BottomRight (a, b) - | exception _ -> Cpdfposition.BottomRight (Cpdfcoord.parse_single_number empty n, 0.) + | exception _ -> + let x = Cpdfcoord.parse_single_number empty n in + Cpdfposition.BottomRight (x, x) in args.position <- coord; args.justification <- Cpdfaddtext.RightJustify