Skip to content

Commit

Permalink
replace textsize by textlength
Browse files Browse the repository at this point in the history
  • Loading branch information
jburel committed Jan 10, 2024
1 parent ab5df60 commit 749180a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion omero/figure_scripts/Movie_Figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def add_left_labels(panel_canvas, image_labels, row_index, width, spacer):
py = left_text_height - text_gap # start at bottom
for count, label in enumerate(labels):
py = py - text_height # find the top of this row
w = textdraw.textsize(label, font=font)[0]
w = textdraw.textlength(label, font=font)[0]
inset = int((left_text_width - w) / 2)
textdraw.text((inset, py), label, font=font, fill=(0, 0, 0))
py = py - text_gap # add space between rows
Expand Down
2 changes: 1 addition & 1 deletion omero/figure_scripts/Split_View_Figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def make_split_view_figure(conn, pixel_ids, z_start, z_end, split_indexes,
py = left_text_width - text_gap # start at bottom
for count, label in enumerate(row):
py = py - text_height # find the top of this row
w = textdraw.textsize(label, font=font)[0]
w = textdraw.textlength(label, font=font)[0]
inset = int((height - w) // 2)
textdraw.text((px+inset, py), label, font=font,
fill=(0, 0, 0))
Expand Down
4 changes: 2 additions & 2 deletions omero/figure_scripts/Thumbnail_Figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ def make_tagset_canvas(tag_string, tagset_pix_ids, show_subset_labels):
# figureDate = "%s - %s" % (firstdate, lastdate)

draw = ImageDraw.Draw(full_canvas)
# dateWidth = draw.textsize(figureDate, font=font)[0]
# titleWidth = draw.textsize(title, font=font)[0]
# dateWidth = draw.textlength(figureDate, font=font)[0]
# titleWidth = draw.textlength(title, font=font)[0]
# dateX = fullCanvas.size[0] - spacing - dateWidth
# title
draw.text((left_spacer, spacing), title, font=font, fill=(0, 0, 0))
Expand Down

0 comments on commit 749180a

Please sign in to comment.