static GimpValueArray * image_delete_sample_point_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpImage *image; gint32 sample_point; image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp); sample_point = g_value_get_uint (gimp_value_array_index (args, 1)); if (success) { GimpSamplePoint *sp = gimp_pdb_image_get_sample_point (image, sample_point, error); if (sp) gimp_image_remove_sample_point (image, sp, TRUE); else success = FALSE; } return gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); }
static void gimp_sample_point_undo_pop (GimpUndo *undo, GimpUndoMode undo_mode, GimpUndoAccumulator *accum) { GimpSamplePointUndo *sample_point_undo = GIMP_SAMPLE_POINT_UNDO (undo); gint x; gint y; GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum); x = sample_point_undo->sample_point->x; y = sample_point_undo->sample_point->y; /* add and move sample points manually (nor using the * gimp_image_sample_point API), because we might be in the middle * of an image resizing undo group and the sample point's position * might be temporarily out of image. */ if (x == -1) { undo->image->sample_points = g_list_append (undo->image->sample_points, sample_point_undo->sample_point); sample_point_undo->sample_point->x = sample_point_undo->x; sample_point_undo->sample_point->y = sample_point_undo->y; gimp_sample_point_ref (sample_point_undo->sample_point); gimp_image_sample_point_added (undo->image, sample_point_undo->sample_point); gimp_image_update_sample_point (undo->image, sample_point_undo->sample_point); } else if (sample_point_undo->x == -1) { gimp_image_remove_sample_point (undo->image, sample_point_undo->sample_point, FALSE); } else { gimp_image_update_sample_point (undo->image, sample_point_undo->sample_point); sample_point_undo->sample_point->x = sample_point_undo->x; sample_point_undo->sample_point->y = sample_point_undo->y; gimp_image_update_sample_point (undo->image, sample_point_undo->sample_point); } sample_point_undo->x = x; sample_point_undo->y = y; }
static void gimp_sample_point_undo_pop (GimpUndo *undo, GimpUndoMode undo_mode, GimpUndoAccumulator *accum) { GimpSamplePointUndo *sample_point_undo = GIMP_SAMPLE_POINT_UNDO (undo); GimpSamplePoint *sample_point; gint x; gint y; GimpColorPickMode pick_mode; GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum); sample_point = GIMP_SAMPLE_POINT (GIMP_AUX_ITEM_UNDO (undo)->aux_item); gimp_sample_point_get_position (sample_point, &x, &y); pick_mode = gimp_sample_point_get_pick_mode (sample_point); if (x == GIMP_SAMPLE_POINT_POSITION_UNDEFINED) { gimp_image_add_sample_point (undo->image, sample_point, sample_point_undo->x, sample_point_undo->y); } else if (sample_point_undo->x == GIMP_SAMPLE_POINT_POSITION_UNDEFINED) { gimp_image_remove_sample_point (undo->image, sample_point, FALSE); } else { gimp_sample_point_set_position (sample_point, sample_point_undo->x, sample_point_undo->y); gimp_sample_point_set_pick_mode (sample_point, sample_point_undo->pick_mode); gimp_image_sample_point_moved (undo->image, sample_point); } sample_point_undo->x = x; sample_point_undo->y = y; sample_point_undo->pick_mode = pick_mode; }
static void gimp_sample_point_undo_pop (GimpUndo *undo, GimpUndoMode undo_mode, GimpUndoAccumulator *accum) { GimpSamplePointUndo *sample_point_undo = GIMP_SAMPLE_POINT_UNDO (undo); gint x; gint y; GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum); x = sample_point_undo->sample_point->x; y = sample_point_undo->sample_point->y; if (x == -1) { gimp_image_add_sample_point (undo->image, sample_point_undo->sample_point, sample_point_undo->x, sample_point_undo->y); } else if (sample_point_undo->x == -1) { gimp_image_remove_sample_point (undo->image, sample_point_undo->sample_point, FALSE); } else { sample_point_undo->sample_point->x = sample_point_undo->x; sample_point_undo->sample_point->y = sample_point_undo->y; gimp_image_sample_point_moved (undo->image, sample_point_undo->sample_point); } sample_point_undo->x = x; sample_point_undo->y = y; }
static void gimp_color_tool_button_release (GimpTool *tool, const GimpCoords *coords, guint32 time, GdkModifierType state, GimpButtonReleaseType release_type, GimpDisplay *display) { GimpColorTool *color_tool = GIMP_COLOR_TOOL (tool); GimpDisplayShell *shell = gimp_display_get_shell (display); /* Chain up to halt the tool */ GIMP_TOOL_CLASS (parent_class)->button_release (tool, coords, time, state, release_type, display); if (! color_tool->enabled) return; if (color_tool->moving_sample_point) { GimpImage *image = gimp_display_get_image (display); gint width = gimp_image_get_width (image); gint height = gimp_image_get_height (image); gimp_tool_pop_status (tool, display); gimp_tool_control_set_scroll_lock (tool->control, FALSE); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); if (release_type == GIMP_BUTTON_RELEASE_CANCEL) { color_tool->moving_sample_point = FALSE; color_tool->sample_point_x = SAMPLE_POINT_POSITION_INVALID; color_tool->sample_point_y = SAMPLE_POINT_POSITION_INVALID; gimp_display_shell_selection_resume (shell); return; } if (color_tool->sample_point_x == SAMPLE_POINT_POSITION_INVALID || color_tool->sample_point_x < 0 || color_tool->sample_point_x >= width || color_tool->sample_point_y == SAMPLE_POINT_POSITION_INVALID || color_tool->sample_point_y < 0 || color_tool->sample_point_y >= height) { if (color_tool->sample_point) { gimp_image_remove_sample_point (image, color_tool->sample_point, TRUE); color_tool->sample_point = NULL; } } else { if (color_tool->sample_point) { gimp_image_move_sample_point (image, color_tool->sample_point, color_tool->sample_point_x, color_tool->sample_point_y, TRUE); } else { color_tool->sample_point = gimp_image_add_sample_point_at_pos (image, color_tool->sample_point_x, color_tool->sample_point_y, TRUE); } } gimp_display_shell_selection_resume (shell); gimp_image_flush (image); color_tool->moving_sample_point = FALSE; color_tool->sample_point_x = SAMPLE_POINT_POSITION_INVALID; color_tool->sample_point_y = SAMPLE_POINT_POSITION_INVALID; if (color_tool->sample_point) gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display); } else { gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); } }
void gimp_image_resize_with_layers (GimpImage *image, GimpContext *context, gint new_width, gint new_height, gint offset_x, gint offset_y, GimpItemSet layer_set, gboolean resize_text_layers, GimpProgress *progress) { GList *list; GList *resize_layers; gdouble progress_max; gdouble progress_current = 1.0; gint old_width, old_height; g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (new_width > 0 && new_height > 0); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); gimp_set_busy (image->gimp); g_object_freeze_notify (G_OBJECT (image)); gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_RESIZE, C_("undo-type", "Resize Image")); resize_layers = gimp_image_item_list_get_list (image, NULL, GIMP_ITEM_TYPE_LAYERS, layer_set); progress_max = (gimp_container_get_n_children (gimp_image_get_layers (image)) + gimp_container_get_n_children (gimp_image_get_channels (image)) + gimp_container_get_n_children (gimp_image_get_vectors (image)) + g_list_length (resize_layers) + 1 /* selection */); old_width = gimp_image_get_width (image); old_height = gimp_image_get_height (image); /* Push the image size to the stack */ gimp_image_undo_push_image_size (image, NULL, -offset_x, -offset_y, new_width, new_height); /* Set the new width and height */ g_object_set (image, "width", new_width, "height", new_height, NULL); /* Resize all channels */ for (list = gimp_image_get_channel_iter (image); list; list = g_list_next (list)) { GimpItem *item = list->data; gimp_item_resize (item, context, new_width, new_height, offset_x, offset_y); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); } /* Resize all vectors */ for (list = gimp_image_get_vectors_iter (image); list; list = g_list_next (list)) { GimpItem *item = list->data; gimp_item_resize (item, context, new_width, new_height, offset_x, offset_y); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); } /* Don't forget the selection mask! */ gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (image)), context, new_width, new_height, offset_x, offset_y); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); /* Reposition all layers */ for (list = gimp_image_get_layer_iter (image); list; list = g_list_next (list)) { GimpItem *item = list->data; gimp_item_translate (item, offset_x, offset_y, TRUE); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); } /* Resize all resize_layers to image size */ for (list = resize_layers; list; list = g_list_next (list)) { GimpItem *item = list->data; gint old_offset_x; gint old_offset_y; /* group layers can't be resized here */ if (gimp_viewable_get_children (GIMP_VIEWABLE (item))) continue; if (! resize_text_layers && gimp_item_is_text_layer (item)) continue; gimp_item_get_offset (item, &old_offset_x, &old_offset_y); gimp_item_resize (item, context, new_width, new_height, old_offset_x, old_offset_y); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); } g_list_free (resize_layers); /* Reposition or remove all guides */ list = gimp_image_get_guides (image); while (list) { GimpGuide *guide = list->data; gboolean remove_guide = FALSE; gint new_position = gimp_guide_get_position (guide); list = g_list_next (list); switch (gimp_guide_get_orientation (guide)) { case GIMP_ORIENTATION_HORIZONTAL: new_position += offset_y; if (new_position < 0 || new_position > new_height) remove_guide = TRUE; break; case GIMP_ORIENTATION_VERTICAL: new_position += offset_x; if (new_position < 0 || new_position > new_width) remove_guide = TRUE; break; default: break; } if (remove_guide) gimp_image_remove_guide (image, guide, TRUE); else if (new_position != gimp_guide_get_position (guide)) gimp_image_move_guide (image, guide, new_position, TRUE); } /* Reposition or remove sample points */ list = gimp_image_get_sample_points (image); while (list) { GimpSamplePoint *sample_point = list->data; gboolean remove_sample_point = FALSE; gint new_x = sample_point->x; gint new_y = sample_point->y; list = g_list_next (list); new_y += offset_y; if ((sample_point->y < 0) || (sample_point->y > new_height)) remove_sample_point = TRUE; new_x += offset_x; if ((sample_point->x < 0) || (sample_point->x > new_width)) remove_sample_point = TRUE; if (remove_sample_point) gimp_image_remove_sample_point (image, sample_point, TRUE); else if (new_x != sample_point->x || new_y != sample_point->y) gimp_image_move_sample_point (image, sample_point, new_x, new_y, TRUE); } gimp_image_undo_group_end (image); gimp_image_size_changed_detailed (image, offset_x, offset_y, old_width, old_height); g_object_thaw_notify (G_OBJECT (image)); gimp_unset_busy (image->gimp); }
static void gimp_color_tool_button_release (GimpTool *tool, GimpCoords *coords, guint32 time, GdkModifierType state, GimpButtonReleaseType release_type, GimpDisplay *display) { GimpColorTool *color_tool = GIMP_COLOR_TOOL (tool); GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell); /* Chain up to halt the tool */ GIMP_TOOL_CLASS (parent_class)->button_release (tool, coords, time, state, release_type, display); if (! color_tool->enabled) return; if (color_tool->moving_sample_point) { gint x, y, width, height; gimp_tool_pop_status (tool, display); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); if (release_type == GIMP_BUTTON_RELEASE_CANCEL) { color_tool->moving_sample_point = FALSE; color_tool->sample_point_x = -1; color_tool->sample_point_y = -1; gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME); return; } gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height); if ((color_tool->sample_point_x < x || color_tool->sample_point_x > (x + width - 1) || color_tool->sample_point_y < y || color_tool->sample_point_y > (y + height - 1))) { if (color_tool->sample_point) { gimp_image_remove_sample_point (display->image, color_tool->sample_point, TRUE); color_tool->sample_point = NULL; } } else { if (color_tool->sample_point) { gimp_image_move_sample_point (display->image, color_tool->sample_point, color_tool->sample_point_x, color_tool->sample_point_y, TRUE); } else { color_tool->sample_point = gimp_image_add_sample_point_at_pos (display->image, color_tool->sample_point_x, color_tool->sample_point_y, TRUE); } } gimp_display_shell_selection_control (shell, GIMP_SELECTION_RESUME); gimp_image_flush (display->image); if (color_tool->sample_point) gimp_display_shell_draw_sample_point (shell, color_tool->sample_point, TRUE); color_tool->moving_sample_point = FALSE; color_tool->sample_point_x = -1; color_tool->sample_point_y = -1; } else { gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); } }
void gimp_image_crop (GimpImage *image, GimpContext *context, gint x1, gint y1, gint x2, gint y2, gboolean active_layer_only, gboolean crop_layers) { gint width, height; gint previous_width, previous_height; g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); previous_width = gimp_image_get_width (image); previous_height = gimp_image_get_height (image); width = x2 - x1; height = y2 - y1; /* Make sure new width and height are non-zero */ if (width < 1 || height < 1) return; gimp_set_busy (image->gimp); if (active_layer_only) { GimpLayer *layer; gint off_x, off_y; layer = gimp_image_get_active_layer (image); gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y); off_x -= x1; off_y -= y1; gimp_item_resize (GIMP_ITEM (layer), context, width, height, off_x, off_y); } else { GimpItem *item; GList *list; g_object_freeze_notify (G_OBJECT (image)); if (crop_layers) gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_CROP, C_("command", "Crop Image")); else gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_RESIZE, _("Resize Image")); /* Push the image size to the stack */ gimp_image_undo_push_image_size (image, NULL, x1, y1, width, height); /* Set the new width and height */ g_object_set (image, "width", width, "height", height, NULL); /* Resize all channels */ for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { item = (GimpItem *) list->data; gimp_item_resize (item, context, width, height, -x1, -y1); } /* Resize all vectors */ for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { item = (GimpItem *) list->data; gimp_item_resize (item, context, width, height, -x1, -y1); } /* Don't forget the selection mask! */ gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (image)), context, width, height, -x1, -y1); /* crop all layers */ list = GIMP_LIST (image->layers)->list; while (list) { item = (GimpItem *) list->data; list = g_list_next (list); gimp_item_translate (item, -x1, -y1, TRUE); if (crop_layers) { gint off_x, off_y; gint lx1, ly1, lx2, ly2; gimp_item_offsets (item, &off_x, &off_y); lx1 = CLAMP (off_x, 0, gimp_image_get_width (image)); ly1 = CLAMP (off_y, 0, gimp_image_get_height (image)); lx2 = CLAMP (gimp_item_width (item) + off_x, 0, gimp_image_get_width (image)); ly2 = CLAMP (gimp_item_height (item) + off_y, 0, gimp_image_get_height (image)); width = lx2 - lx1; height = ly2 - ly1; if (width > 0 && height > 0) gimp_item_resize (item, context, width, height, -(lx1 - off_x), -(ly1 - off_y)); else gimp_image_remove_layer (image, GIMP_LAYER (item)); } } /* Reposition or remove all guides */ list = gimp_image_get_guides (image); while (list) { GimpGuide *guide = list->data; gboolean remove_guide = FALSE; gint position = gimp_guide_get_position (guide); list = g_list_next (list); switch (gimp_guide_get_orientation (guide)) { case GIMP_ORIENTATION_HORIZONTAL: if ((position < y1) || (position > y2)) remove_guide = TRUE; else position -= y1; break; case GIMP_ORIENTATION_VERTICAL: if ((position < x1) || (position > x2)) remove_guide = TRUE; else position -= x1; break; default: break; } if (remove_guide) gimp_image_remove_guide (image, guide, TRUE); else if (position != gimp_guide_get_position (guide)) gimp_image_move_guide (image, guide, position, TRUE); } /* Reposition or remove sample points */ list = gimp_image_get_sample_points (image); while (list) { GimpSamplePoint *sample_point = list->data; gboolean remove_sample_point = FALSE; gint new_x = sample_point->x; gint new_y = sample_point->y; list = g_list_next (list); new_y -= y1; if ((sample_point->y < y1) || (sample_point->y > y2)) remove_sample_point = TRUE; new_x -= x1; if ((sample_point->x < x1) || (sample_point->x > x2)) remove_sample_point = TRUE; if (remove_sample_point) gimp_image_remove_sample_point (image, sample_point, TRUE); else if (new_x != sample_point->x || new_y != sample_point->y) gimp_image_move_sample_point (image, sample_point, new_x, new_y, TRUE); } gimp_image_undo_group_end (image); gimp_image_update (image, 0, 0, gimp_image_get_width (image), gimp_image_get_height (image)); gimp_image_size_changed_detailed (image, -x1, -y1, previous_width, previous_height); g_object_thaw_notify (G_OBJECT (image)); } gimp_unset_busy (image->gimp); }
void gimp_image_crop (GimpImage *image, GimpContext *context, GimpFillType fill_type, gint x, gint y, gint width, gint height, gboolean crop_layers) { GList *list; gint previous_width; gint previous_height; g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); previous_width = gimp_image_get_width (image); previous_height = gimp_image_get_height (image); /* Make sure new width and height are non-zero */ if (width < 1 || height < 1) return; gimp_set_busy (image->gimp); g_object_freeze_notify (G_OBJECT (image)); if (crop_layers) gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_CROP, C_("undo-type", "Crop Image")); else gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_RESIZE, C_("undo-type", "Resize Image")); /* Push the image size to the stack */ gimp_image_undo_push_image_size (image, NULL, x, y, width, height); /* Set the new width and height */ g_object_set (image, "width", width, "height", height, NULL); /* Resize all channels */ for (list = gimp_image_get_channel_iter (image); list; list = g_list_next (list)) { GimpItem *item = list->data; gimp_item_resize (item, context, GIMP_FILL_TRANSPARENT, width, height, -x, -y); } /* Resize all vectors */ for (list = gimp_image_get_vectors_iter (image); list; list = g_list_next (list)) { GimpItem *item = list->data; gimp_item_resize (item, context, GIMP_FILL_TRANSPARENT, width, height, -x, -y); } /* Don't forget the selection mask! */ gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (image)), context, GIMP_FILL_TRANSPARENT, width, height, -x, -y); /* crop all layers */ list = gimp_image_get_layer_iter (image); while (list) { GimpItem *item = list->data; list = g_list_next (list); gimp_item_translate (item, -x, -y, TRUE); if (crop_layers) { gint off_x, off_y; gint lx1, ly1, lx2, ly2; gimp_item_get_offset (item, &off_x, &off_y); lx1 = CLAMP (off_x, 0, gimp_image_get_width (image)); ly1 = CLAMP (off_y, 0, gimp_image_get_height (image)); lx2 = CLAMP (gimp_item_get_width (item) + off_x, 0, gimp_image_get_width (image)); ly2 = CLAMP (gimp_item_get_height (item) + off_y, 0, gimp_image_get_height (image)); width = lx2 - lx1; height = ly2 - ly1; if (width > 0 && height > 0) { gimp_item_resize (item, context, fill_type, width, height, -(lx1 - off_x), -(ly1 - off_y)); } else { gimp_image_remove_layer (image, GIMP_LAYER (item), TRUE, NULL); } } } /* Reposition or remove guides */ list = gimp_image_get_guides (image); while (list) { GimpGuide *guide = list->data; gboolean remove_guide = FALSE; gint position = gimp_guide_get_position (guide); list = g_list_next (list); switch (gimp_guide_get_orientation (guide)) { case GIMP_ORIENTATION_HORIZONTAL: position -= y; if ((position < 0) || (position > height)) remove_guide = TRUE; break; case GIMP_ORIENTATION_VERTICAL: position -= x; if ((position < 0) || (position > width)) remove_guide = TRUE; break; default: break; } if (remove_guide) gimp_image_remove_guide (image, guide, TRUE); else if (position != gimp_guide_get_position (guide)) gimp_image_move_guide (image, guide, position, TRUE); } /* Reposition or remove sample points */ list = gimp_image_get_sample_points (image); while (list) { GimpSamplePoint *sample_point = list->data; gboolean remove_sample_point = FALSE; gint old_x; gint old_y; gint new_x; gint new_y; list = g_list_next (list); gimp_sample_point_get_position (sample_point, &old_x, &old_y); new_x = old_x; new_y = old_y; new_y -= y; if ((new_y < 0) || (new_y > height)) remove_sample_point = TRUE; new_x -= x; if ((new_x < 0) || (new_x > width)) remove_sample_point = TRUE; if (remove_sample_point) gimp_image_remove_sample_point (image, sample_point, TRUE); else if (new_x != old_x || new_y != old_y) gimp_image_move_sample_point (image, sample_point, new_x, new_y, TRUE); } gimp_image_undo_group_end (image); gimp_image_size_changed_detailed (image, -x, -y, previous_width, previous_height); g_object_thaw_notify (G_OBJECT (image)); gimp_unset_busy (image->gimp); }
static void gimp_sample_point_tool_button_release (GimpTool *tool, const GimpCoords *coords, guint32 time, GdkModifierType state, GimpButtonReleaseType release_type, GimpDisplay *display) { GimpSamplePointTool *sp_tool = GIMP_SAMPLE_POINT_TOOL (tool); GimpDisplayShell *shell = gimp_display_get_shell (display); GimpImage *image = gimp_display_get_image (display); gimp_tool_pop_status (tool, display); gimp_tool_control_halt (tool->control); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); if (release_type != GIMP_BUTTON_RELEASE_CANCEL) { gint width = gimp_image_get_width (image); gint height = gimp_image_get_height (image); if (sp_tool->sample_point_x == GIMP_SAMPLE_POINT_POSITION_UNDEFINED || sp_tool->sample_point_x < 0 || sp_tool->sample_point_x >= width || sp_tool->sample_point_y == GIMP_SAMPLE_POINT_POSITION_UNDEFINED || sp_tool->sample_point_y < 0 || sp_tool->sample_point_y >= height) { if (sp_tool->sample_point) { gimp_image_remove_sample_point (image, sp_tool->sample_point, TRUE); sp_tool->sample_point = NULL; } } else { if (sp_tool->sample_point) { gimp_image_move_sample_point (image, sp_tool->sample_point, sp_tool->sample_point_x, sp_tool->sample_point_y, TRUE); } else { sp_tool->sample_point = gimp_image_add_sample_point_at_pos (image, sp_tool->sample_point_x, sp_tool->sample_point_y, TRUE); } } gimp_image_flush (image); } gimp_display_shell_selection_resume (shell); sp_tool->sample_point_x = GIMP_SAMPLE_POINT_POSITION_UNDEFINED; sp_tool->sample_point_y = GIMP_SAMPLE_POINT_POSITION_UNDEFINED; tool_manager_pop_tool (display->gimp); g_object_unref (sp_tool); { GimpTool *active_tool = tool_manager_get_active (display->gimp); if (GIMP_IS_DRAW_TOOL (active_tool)) gimp_draw_tool_pause (GIMP_DRAW_TOOL (active_tool)); tool_manager_oper_update_active (display->gimp, coords, state, TRUE, display); tool_manager_cursor_update_active (display->gimp, coords, state, display); if (GIMP_IS_DRAW_TOOL (active_tool)) gimp_draw_tool_resume (GIMP_DRAW_TOOL (active_tool)); } }