fix:边框随倍数增加

This commit is contained in:
fuzhongyun 2025-12-31 08:57:05 +08:00
parent fae6bb1b2a
commit 325aa3302b
1 changed files with 3 additions and 1 deletions

View File

@ -164,7 +164,9 @@ class ExcelRenderer:
bg_color = self._parse_color(fill_color, default=(255, 255, 255))
# Draw background and border
draw.rectangle([x1, y1, x2, y2], fill=bg_color, outline=(200, 200, 200))
# Scale border width: at least 1px, roughly 1px per scale unit but kept thin for aesthetics
border_width = max(1, scale)
draw.rectangle([x1, y1, x2, y2], fill=bg_color, outline=(200, 200, 200), width=border_width)
# Content
cell_value = cell.value