Don't directly access widget->allocation

This commit is contained in:
Paul Dicker
2025-03-30 12:04:01 +02:00
committed by Stéphane Lesimple
parent 3967ff3cae
commit eadbf54aae
8 changed files with 36 additions and 25 deletions

View File

@@ -280,7 +280,8 @@ void GuiMarkExistingSectors(void)
static void update_geometry(void)
{ GtkWidget *widget = Closure->readLinearDrawingArea;
GtkAllocation *a = &widget->allocation;
GtkAllocation a = {0};
gtk_widget_get_allocation(widget, &a);
/* Curve geometry */
@@ -289,8 +290,8 @@ static void update_geometry(void)
/* Spiral center */
Closure->readLinearSpiral->mx = a->width - 15 - Closure->readLinearSpiral->diameter / 2;
Closure->readLinearSpiral->my = a->height / 2;
Closure->readLinearSpiral->mx = a.width - 15 - Closure->readLinearSpiral->diameter / 2;
Closure->readLinearSpiral->my = a.height / 2;
if(Closure->crcBuf && Closure->crcBuf->crcCached)
{ int w,h;