From b0a5ff18d5e5a1a4836599aedd53daf178811a9f Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Tue, 9 Dec 2025 10:49:26 -0500 Subject: [PATCH] views/month-view-row: Compute exact width of event widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, month cells are using `round()` to allocate the width, whereas event widgets are using implicit double → int conversion, which causes event widgets to be offset by a pixel, and thus touches month cells' borders. This new approach guarantees the exact width of the event widgets by invoking `round()`. Part-of: --- src/gui/views/gcal-month-view-row.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/views/gcal-month-view-row.c b/src/gui/views/gcal-month-view-row.c index 424e19c7..b8c2f8db 100644 --- a/src/gui/views/gcal-month-view-row.c +++ b/src/gui/views/gcal-month-view-row.c @@ -574,12 +574,17 @@ gcal_month_view_row_size_allocate (GtkWidget *widget, { GcalEventBlock *block; GtkAllocation allocation; + gint start_cell; + gint end_cell; block = g_ptr_array_index (blocks, block_index); - allocation.x = (is_ltr ? block->cell : 7 - block->cell - block->length) * cell_width; + start_cell = is_ltr ? block->cell : 7 - block->cell - block->length; + end_cell = start_cell + block->length; + + allocation.x = round (start_cell * cell_width); allocation.y = cell_y[block->cell]; - allocation.width = block->length * cell_width; + allocation.width = round (end_cell * cell_width); allocation.height = block->height; gtk_widget_set_child_visible (block->event_widget, block->visible);