diff options
author | jaseg <git@jaseg.de> | 2024-07-07 14:40:27 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2024-07-07 14:40:27 +0200 |
commit | cee355ff57e859466e4f74d1f57d68eeedb54ce1 (patch) | |
tree | 0beb3943c1e00c544f768e1206e39413784da4f6 /gerbonara/cad/primitives.py | |
parent | 4c3815b25a23f8df2d6bfdab83962367150bd285 (diff) | |
download | gerbonara-cee355ff57e859466e4f74d1f57d68eeedb54ce1.tar.gz gerbonara-cee355ff57e859466e4f74d1f57d68eeedb54ce1.tar.bz2 gerbonara-cee355ff57e859466e4f74d1f57d68eeedb54ce1.zip |
protoboard: fix column label alignment
Diffstat (limited to 'gerbonara/cad/primitives.py')
-rw-r--r-- | gerbonara/cad/primitives.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gerbonara/cad/primitives.py b/gerbonara/cad/primitives.py index a5c5209..c659274 100644 --- a/gerbonara/cad/primitives.py +++ b/gerbonara/cad/primitives.py @@ -322,6 +322,7 @@ class Text(Positioned): xs = [x for points in strokes for x, _y in points] ys = [y for points in strokes for _x, y in points] min_x, min_y, max_x, max_y = min(xs), min(ys), max(xs), max(ys) + h = (max_y - min_y) if self.h_align == 'left': x0 = 0 @@ -333,9 +334,9 @@ class Text(Positioned): raise ValueError('h_align must be one of "left", "center", or "right".') if self.v_align == 'bottom': - y0 = -(max_y - min_y) + y0 = h elif self.v_align == 'middle': - y0 = (max_y - min_y)/2 + y0 = h/2 elif self.v_align == 'top': y0 = 0 else: |