mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
plug-ins: Fix preview for Blinds GUI
Resolves #11092
Same fix as in 2b3b2af2
, since Blinds and Jigsaw
were the two plug-ins which used GimpAspectPreview
before the port to GimpProcedureDialog.
This commit is contained in:
parent
2b3b2af26d
commit
32c9a9a6cc
1 changed files with 18 additions and 18 deletions
|
@ -305,8 +305,6 @@ blinds_dialog (GimpProcedure *procedure,
|
||||||
"preview", drawable);
|
"preview", drawable);
|
||||||
gtk_widget_set_margin_bottom (preview, 12);
|
gtk_widget_set_margin_bottom (preview, 12);
|
||||||
|
|
||||||
g_object_set_data (config, "drawable", drawable);
|
|
||||||
|
|
||||||
g_signal_connect (preview, "invalidated",
|
g_signal_connect (preview, "invalidated",
|
||||||
G_CALLBACK (dialog_update_preview),
|
G_CALLBACK (dialog_update_preview),
|
||||||
config);
|
config);
|
||||||
|
@ -445,27 +443,27 @@ static void
|
||||||
dialog_update_preview (GtkWidget *widget,
|
dialog_update_preview (GtkWidget *widget,
|
||||||
GObject *config)
|
GObject *config)
|
||||||
{
|
{
|
||||||
GimpPreview *preview = GIMP_PREVIEW (widget);
|
GimpDrawablePreview *preview = GIMP_DRAWABLE_PREVIEW (widget);
|
||||||
GimpDrawable *drawable = g_object_get_data (config, "drawable");
|
GimpDrawable *drawable = gimp_drawable_preview_get_drawable (preview);
|
||||||
gint y;
|
gint y;
|
||||||
const guchar *p;
|
const guchar *p;
|
||||||
guchar *buffer;
|
guchar *buffer;
|
||||||
GBytes *cache;
|
GBytes *cache;
|
||||||
const guchar *cache_start;
|
const guchar *cache_start;
|
||||||
GeglColor *color;
|
GeglColor *color;
|
||||||
guchar bg[4];
|
guchar bg[4];
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
gint bpp;
|
gint bpp;
|
||||||
GimpOrientationType orientation;
|
GimpOrientationType orientation;
|
||||||
gint bg_trans;
|
gint bg_trans;
|
||||||
|
|
||||||
g_object_get (config,
|
g_object_get (config,
|
||||||
"bg-transparent", &bg_trans,
|
"bg-transparent", &bg_trans,
|
||||||
"orientation", &orientation,
|
"orientation", &orientation,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gimp_preview_get_size (preview, &width, &height);
|
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
|
||||||
cache = gimp_drawable_get_thumbnail_data (drawable,
|
cache = gimp_drawable_get_thumbnail_data (drawable,
|
||||||
width, height,
|
width, height,
|
||||||
&width, &height, &bpp);
|
&width, &height, &bpp);
|
||||||
|
@ -561,7 +559,9 @@ dialog_update_preview (GtkWidget *widget,
|
||||||
g_free (dr);
|
g_free (dr);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_preview_draw_buffer (preview, buffer, width * bpp);
|
gimp_preview_draw_buffer (GIMP_PREVIEW (preview), buffer, width * bpp);
|
||||||
|
gimp_preview_set_bounds (GIMP_PREVIEW (preview), 0, 0, width, height);
|
||||||
|
gimp_preview_set_size (GIMP_PREVIEW (preview), width, height);
|
||||||
|
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
g_bytes_unref (cache);
|
g_bytes_unref (cache);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue