Commit dac5ed76 authored by Sean Fitzgibbon's avatar Sean Fitzgibbon
Browse files

Forgot to at left justification

parent b67fd752
......@@ -403,7 +403,7 @@ def init_scale(img, img_resolution, crd, tol=0.05, justify=None):
# print(img_p)
# print(crd_p)
if justify=='right':
if justify is not None:
print(f'justify chart bbox to {justify} in image bbox')
......@@ -413,7 +413,14 @@ def init_scale(img, img_resolution, crd, tol=0.05, justify=None):
scale_factor = crd_p['aspect_ratio'] / img_p['aspect_ratio']
new_w = w * scale_factor
bbox[1] += (w - new_w)
if justify=='right':
bbox[1] += (w - new_w)
elif justify=='left':
bbox[3] -= (w - new_w)
else:
raise ValueError(f'Unknown value for justify ("{justify}"). Can only be "left" or "right".')
centroid = (
(bbox[0] + bbox[2]) / 2,
(bbox[1] + bbox[3]) / 2,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment