From 9a6ed555c804681cc343d080f89c8d0f275a116c Mon Sep 17 00:00:00 2001 From: Vinayak Mehta Date: Sun, 9 Sep 2018 10:04:54 +0530 Subject: [PATCH] Fix get_rotation --- camelot/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/camelot/utils.py b/camelot/utils.py index 075c0df..3e87fe5 100644 --- a/camelot/utils.py +++ b/camelot/utils.py @@ -215,8 +215,9 @@ def get_rotation(lttextlh, lttextlv, ltchar): Returns ------- rotation : string - '' if text in table is upright, 'left' if rotated 90 degree - anticlockwise and 'right' if rotated 90 degree clockwise. + '' if text in table is upright, 'anticlockwise' if + rotated 90 degree anticlockwise and 'clockwise' if + rotated 90 degree clockwise. """ rotation = '' @@ -225,7 +226,7 @@ def get_rotation(lttextlh, lttextlv, ltchar): if hlen < vlen: clockwise = sum(t.matrix[1] < 0 and t.matrix[2] > 0 for t in ltchar) anticlockwise = sum(t.matrix[1] > 0 and t.matrix[2] < 0 for t in ltchar) - rotation = 'clockwise' if clockwise < anticlockwise else 'anticlockwise' + rotation = 'anticlockwise' if clockwise < anticlockwise else 'clockwise' return rotation