mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
plug-ins: Fix preview for Jigsaw GUI
After the port to gimp_procedure_dialog_get_drawable_preview (), the preview widget was being sized to the original drawable's dimensions while the drawable was being redrawn with only its thumbnail dimensions. This created a scrollbar that showed unallocated/overwritten buffers. To fix, we update the preview size and boundaries whenever the preview is changed. This removes the scrollbar and returns to 2.10 behavior.
This commit is contained in:
parent
879cec8786
commit
2b3b2af26d
1 changed files with 11 additions and 5 deletions
|
@ -517,9 +517,11 @@ jigsaw (GObject *config,
|
|||
GBytes *buffer_bytes;
|
||||
|
||||
gimp_preview_get_size (preview, &width, &height);
|
||||
|
||||
buffer_bytes = gimp_drawable_get_thumbnail_data (drawable,
|
||||
width, height,
|
||||
&width, &height, &bytes);
|
||||
|
||||
buffer = g_bytes_unref_to_data (buffer_bytes, &buffer_size);
|
||||
}
|
||||
else
|
||||
|
@ -559,6 +561,9 @@ jigsaw (GObject *config,
|
|||
if (preview)
|
||||
{
|
||||
gimp_preview_draw_buffer (preview, buffer, width * bytes);
|
||||
|
||||
gimp_preview_set_bounds (preview, 0, 0, width, height);
|
||||
gimp_preview_set_size (preview, width, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -580,10 +585,13 @@ static void
|
|||
jigsaw_preview (GtkWidget *widget,
|
||||
GObject *config)
|
||||
{
|
||||
GimpPreview *preview = GIMP_PREVIEW (widget);
|
||||
GimpDrawable *drawable = g_object_get_data (config, "drawable");
|
||||
GimpDrawablePreview *preview;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
jigsaw (config, drawable, preview);
|
||||
preview = GIMP_DRAWABLE_PREVIEW (widget);
|
||||
drawable = gimp_drawable_preview_get_drawable (preview);
|
||||
|
||||
jigsaw (config, drawable, GIMP_PREVIEW (widget));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2529,8 +2537,6 @@ jigsaw_dialog (GimpProcedure *procedure,
|
|||
"preview", drawable);
|
||||
gtk_widget_set_margin_bottom (preview, 12);
|
||||
|
||||
g_object_set_data (config, "drawable", drawable);
|
||||
|
||||
g_signal_connect (preview, "invalidated",
|
||||
G_CALLBACK (jigsaw_preview),
|
||||
config);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue