Skip to content

Commit

Permalink
updated text elements to scale with image
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Oct 15, 2024
1 parent b7287ce commit 9f99f04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions markimg/markimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,13 @@ def run(self, options):
#max_x, max_y = image.size
fig = plt.figure(figsize=(max_x / 100, max_y / 100))
plt.imshow(image)

# autoscale text sizes w.r.t. image
options.textSize = fig.get_size_inches()[0] * options.textSize
options.addTextSize = fig.get_size_inches()[0] * options.addTextSize
options.lineGap = fig.get_size_inches()[0] * options.lineGap
options.pointSize = fig.get_size_inches()[0] * options.pointSize

img_XY_plane: ImageCanvas = ImageCanvas(max_y, max_x)
height = data[row]["origHeight"]
ht_scale = height / max_x
Expand Down

0 comments on commit 9f99f04

Please sign in to comment.