Fix up one argument -topleft etc.

This commit is contained in:
John Whitington 2023-06-07 21:52:01 +01:00
parent 94368abbf7
commit 88b0cdefee
1 changed files with 12 additions and 4 deletions

View File

@ -1214,7 +1214,9 @@ let settopleft n =
let coord = let coord =
match Cpdfcoord.parse_coordinate empty n with match Cpdfcoord.parse_coordinate empty n with
| (a, b) -> Cpdfposition.TopLeft (a, b) | (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 in
args.position <- coord; args.position <- coord;
args.justification <- Cpdfaddtext.LeftJustify args.justification <- Cpdfaddtext.LeftJustify
@ -1223,7 +1225,9 @@ let settopright n =
let coord = let coord =
match Cpdfcoord.parse_coordinate empty n with match Cpdfcoord.parse_coordinate empty n with
| (a, b) -> Cpdfposition.TopRight (a, b) | (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 in
args.position <- coord; args.position <- coord;
args.justification <- Cpdfaddtext.RightJustify args.justification <- Cpdfaddtext.RightJustify
@ -1236,7 +1240,9 @@ let setbottomleft n =
let coord = let coord =
match Cpdfcoord.parse_coordinate empty n with match Cpdfcoord.parse_coordinate empty n with
| (a, b) -> Cpdfposition.BottomLeft (a, b) | (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 in
args.position <- coord; args.position <- coord;
args.justification <- Cpdfaddtext.LeftJustify args.justification <- Cpdfaddtext.LeftJustify
@ -1249,7 +1255,9 @@ let setbottomright n =
let coord = let coord =
match Cpdfcoord.parse_coordinate empty n with match Cpdfcoord.parse_coordinate empty n with
| (a, b) -> Cpdfposition.BottomRight (a, b) | (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 in
args.position <- coord; args.position <- coord;
args.justification <- Cpdfaddtext.RightJustify args.justification <- Cpdfaddtext.RightJustify