Skip to content

Commit b54a1b3

Browse files
committed
fix: cast legend row limit to int to satisfy mypy slice index check
1 parent 59c6f3c commit b54a1b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/dirplot/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _draw_legend(
289289
bb = draw.textbbox((0, 0), "Ag", font=font)
290290
text_h = bb[3] - bb[1]
291291
row_h = max(SWATCH_PX, text_h) + LEG_PAD
292-
rows_that_fit = max(1, (height_px - 2 * margin - LEG_PAD * 2 - row_h) // row_h)
292+
rows_that_fit = max(1, int((height_px - 2 * margin - LEG_PAD * 2 - row_h) // row_h))
293293
limit = min(max_rows, rows_that_fit)
294294

295295
ranked = sorted(ext_counts, key=lambda e: (-ext_counts[e], e))

0 commit comments

Comments
 (0)