kopia lustrzana https://gitlab.com/sane-project/frontends
Fix segfault resize preview
rodzic
52a56b6a5b
commit
504dcc8c7f
|
@ -297,9 +297,13 @@ paint_image (Preview * p)
|
|||
|
||||
if (p->preview_row == NULL)
|
||||
p->preview_row = malloc (3 * gwidth);
|
||||
else
|
||||
p->preview_row = realloc (p->preview_row, 3 * gwidth);
|
||||
memset (p->preview_row, 0xff, 3 * gwidth);
|
||||
if (p->preview_data == NULL)
|
||||
p->preview_data = malloc (3 * gwidth * gheight);
|
||||
else
|
||||
p->preview_data = realloc (p->preview_data, 3 * gwidth * gheight);
|
||||
memset (p->preview_data, 0xff, 3 * gwidth * gheight);
|
||||
gtk_widget_queue_draw (p->window);
|
||||
|
||||
|
@ -336,8 +340,8 @@ paint_image (Preview * p)
|
|||
memcpy(p->preview_data + (size_t) dst_y * (size_t) gwidth * 3, p->preview_row, (size_t) gwidth * 3);
|
||||
src_x = 0.0;
|
||||
src_y += yscale;
|
||||
gtk_widget_queue_draw (p->window);
|
||||
}
|
||||
gtk_widget_queue_draw (p->window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -456,7 +460,7 @@ preview_area_resize (GtkWidget * widget, GdkEventConfigure *event, gpointer data
|
|||
|
||||
update_selection (p);
|
||||
paint_image (p);
|
||||
gtk_widget_queue_draw (p->window);
|
||||
//gtk_widget_queue_draw (p->window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Ładowanie…
Reference in New Issue