Skip to content

Commit

Permalink
Merge pull request #76 from paulgavrikov/font_width_fix
Browse files Browse the repository at this point in the history
Applied fix to issue #75 - Will apply a cleaner fix soon.
  • Loading branch information
Soontosh authored Jul 19, 2024
2 parents cf87f08 + 785fc02 commit a35a08b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions visualkeras/layered.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,10 @@ def layered_view(model,
else:
text_width = font.getbbox(label)[2]

if show_dimension:
if hasattr(font, 'getsize'):
text_width += font.getsize('||')[0]
else:
text_width += font.getbbox('||')[2]
if hasattr(font, 'getsize'):
text_width += font.getsize('||')[0]
else:
text_width += font.getbbox('||')[2]

label_patch_size = (cube_size + de + spacing + text_width, cube_size + de)

Expand Down

0 comments on commit a35a08b

Please sign in to comment.