Skip to content

Commit

Permalink
Fix text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
WillB97 committed Dec 7, 2024
1 parent 53104e8 commit f36af42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions april_vision/cli/marker_generator/marker_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ def add_id_number(
- (marker_square_size // 2)
)

# TODO fix vertical alignment
pos_y = self.marker_width - pos_x - text_size / 2
# vertical center is approx 40% of text size above baseline
pos_y = self.marker_width - pos_x - (text_size * 0.4)

self.vectors.add(rl_shapes.String(
pos_x, pos_y,
Expand Down Expand Up @@ -540,8 +540,8 @@ def add_description_border(
)

pos_x, pos_x2 = 0, self.marker_width
# TODO fix vertical alignment
pos_y = - (marker_square_size // 2) - text_size / 2
# vertical center is approx 40% of text size above baseline
pos_y = - (marker_square_size // 2) - (text_size * 0.4)

self.vectors.add(rl_shapes.String(
pos_x, pos_y,
Expand Down

0 comments on commit f36af42

Please sign in to comment.