Commit adadd4bb authored by Ell's avatar Ell

app: add "update" parameter to gimp_drawable_set_buffer_full()

... which specifies whether or not to update the drawable in
response to the buffer change.

Pass TRUE for "update" at all existing call sites, to keep the
current behavior.

(cherry picked from commit 26a8d141)
parent 09d50449
......@@ -611,7 +611,8 @@ gimp_channel_convert (GimpItem *item,
gimp_drawable_set_buffer_full (drawable, FALSE, NULL,
new_buffer,
gimp_item_get_offset_x (item),
gimp_item_get_offset_y (item));
gimp_item_get_offset_y (item),
TRUE);
g_object_unref (new_buffer);
}
......@@ -741,7 +742,8 @@ gimp_channel_scale (GimpItem *item,
gimp_drawable_set_buffer_full (drawable,
gimp_item_is_attached (item), NULL,
new_buffer,
new_offset_x, new_offset_y);
new_offset_x, new_offset_y,
TRUE);
g_object_unref (new_buffer);
gimp_channel_clear (GIMP_CHANNEL (item), NULL, FALSE);
......
......@@ -1080,7 +1080,8 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
{
gimp_drawable_set_buffer_full (drawable, TRUE, NULL,
buffer,
offset_x, offset_y);
offset_x, offset_y,
TRUE);
}
gimp_image_undo_group_end (image);
......
......@@ -494,7 +494,8 @@ gimp_drawable_scale (GimpItem *item,
gimp_drawable_set_buffer_full (drawable, gimp_item_is_attached (item), NULL,
new_buffer,
new_offset_x, new_offset_y);
new_offset_x, new_offset_y,
TRUE);
g_object_unref (new_buffer);
}
......@@ -572,7 +573,8 @@ gimp_drawable_resize (GimpItem *item,
gimp_drawable_set_buffer_full (drawable, gimp_item_is_attached (item), NULL,
new_buffer,
new_offset_x, new_offset_y);
new_offset_x, new_offset_y,
TRUE);
g_object_unref (new_buffer);
}
......@@ -1238,7 +1240,7 @@ gimp_drawable_set_buffer (GimpDrawable *drawable,
gimp_item_get_offset (GIMP_ITEM (drawable), &offset_x, &offset_y);
gimp_drawable_set_buffer_full (drawable, push_undo, undo_desc, buffer,
offset_x, offset_y);
offset_x, offset_y, TRUE);
}
void
......@@ -1247,7 +1249,8 @@ gimp_drawable_set_buffer_full (GimpDrawable *drawable,
const gchar *undo_desc,
GeglBuffer *buffer,
gint offset_x,
gint offset_y)
gint offset_y,
gboolean update)
{
GimpItem *item;
......@@ -1259,10 +1262,11 @@ gimp_drawable_set_buffer_full (GimpDrawable *drawable,
if (! gimp_item_is_attached (GIMP_ITEM (drawable)))
push_undo = FALSE;
if (gimp_item_get_width (item) != gegl_buffer_get_width (buffer) ||
gimp_item_get_height (item) != gegl_buffer_get_height (buffer) ||
gimp_item_get_offset_x (item) != offset_x ||
gimp_item_get_offset_y (item) != offset_y)
if (update &&
(gimp_item_get_width (item) != gegl_buffer_get_width (buffer) ||
gimp_item_get_height (item) != gegl_buffer_get_height (buffer) ||
gimp_item_get_offset_x (item) != offset_x ||
gimp_item_get_offset_y (item) != offset_y))
{
gimp_drawable_update (drawable, 0, 0, -1, -1);
}
......@@ -1276,7 +1280,8 @@ gimp_drawable_set_buffer_full (GimpDrawable *drawable,
g_object_thaw_notify (G_OBJECT (drawable));
gimp_drawable_update (drawable, 0, 0, -1, -1);
if (update)
gimp_drawable_update (drawable, 0, 0, -1, -1);
}
void
......
......@@ -187,7 +187,8 @@ void gimp_drawable_set_buffer_full (GimpDrawable *drawable,
const gchar *undo_desc,
GeglBuffer *buffer,
gint offset_x,
gint offset_y);
gint offset_y,
gboolean update);
void gimp_drawable_steal_buffer (GimpDrawable *drawable,
GimpDrawable *src_drawable);
......
......@@ -198,7 +198,7 @@ gimp_drawable_mod_undo_pop (GimpUndo *undo,
&drawable_mod_undo->offset_y);
gimp_drawable_set_buffer_full (drawable, FALSE, NULL,
buffer, offset_x, offset_y);
buffer, offset_x, offset_y, TRUE);
g_object_unref (buffer);
}
......
......@@ -1000,7 +1000,8 @@ gimp_group_layer_convert_type (GimpLayer *layer,
FALSE, NULL,
buffer,
gimp_item_get_offset_x (GIMP_ITEM (group)),
gimp_item_get_offset_y (GIMP_ITEM (group)));
gimp_item_get_offset_y (GIMP_ITEM (group)),
TRUE);
/* reset, the actual format is right now */
private->convert_format = NULL;
......@@ -1907,7 +1908,8 @@ gimp_group_layer_update_size (GimpGroupLayer *group)
gimp_drawable_set_buffer_full (GIMP_DRAWABLE (group),
FALSE, NULL,
buffer,
x, y);
x, y,
TRUE);
/* reset, the actual size is correct now */
private->reallocate_width = 0;
......@@ -2020,7 +2022,8 @@ gimp_group_layer_update_mask_size (GimpGroupLayer *group)
gimp_drawable_set_buffer_full (GIMP_DRAWABLE (mask),
FALSE, NULL,
buffer, bounds.x, bounds.y);
buffer, bounds.x, bounds.y,
TRUE);
g_object_unref (buffer);
}
......
......@@ -159,7 +159,8 @@ gimp_group_layer_undo_pop (GimpUndo *undo,
FALSE, NULL,
group_layer_undo->mask_buffer,
group_layer_undo->mask_bounds.x,
group_layer_undo->mask_bounds.y);
group_layer_undo->mask_bounds.y,
TRUE);
}
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment