Skip to content

Commit 08877d0

Browse files
committed
added vertical compensation for pulicity circles
1 parent 153426b commit 08877d0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

exec/publicity.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,9 @@ def create_single_week( # noqa: PLR0912, PLR0915
611611
svg.Text(
612612
text=day,
613613
x=base_x + (row_width * cell_width) / 2,
614-
y=base_y + DAY_TEXT_HEIGHT,
614+
y=base_y
615+
+ DAY_TEXT_HEIGHT
616+
- (cell_height / 20 if num_rows == 3 else 0), # noqa: PLR2004
615617
font_size=DAY_TEXT_SIZE,
616618
text_anchor="middle",
617619
class_=["title"],
@@ -621,12 +623,16 @@ def create_single_week( # noqa: PLR0912, PLR0915
621623

622624
for col in range(col_width):
623625
for row in range(row_width):
624-
event_scale = 0.7 if num_rows == 3 else 1.0 # noqa: PLR2004
626+
event_scale = 0.85 if num_rows == 3 else 1.0 # noqa: PLR2004
625627

626628
# work out extra translation required
627629
translate_x = base_x + row * cell_width + cell_width / 2
628630
translate_y = base_y + col * cell_height + cell_height / 2 + DAY_TEXT_HEIGHT / 2
629631

632+
# when 3 rows, events are too low
633+
if num_rows == 3: # noqa: PLR2004
634+
translate_y -= cell_height / 20
635+
630636
# if spanning multiple columns, pull towards centre
631637
pull_y = 0 if col_width == 1 else pull_factor
632638
translate_y = (1 - pull_y) * translate_y + pull_y * centre_y

0 commit comments

Comments
 (0)