mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 12:02:32 +00:00
factored common code out of the UNDO amd REDO cases. Use
2004-09-24 Michael Natterer <mitch@gimp.org> * app/core/gimpimage-undo-push.c (undo_pop_fs_to_layer): factored common code out of the UNDO amd REDO cases. Use gimp_drawable_update() instead of gimp_viewable_invalidate_preview() so the projection gets updated correctly. Fixes bug #149558. * app/core/gimplayer-floating-sel.c (floating_sel_to_layer): removed unused variables and their assignments.
This commit is contained in:
parent
f66f836965
commit
877b19c372
16
ChangeLog
16
ChangeLog
|
@ -1,14 +1,24 @@
|
|||
2004-09-24 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/tools/gimpimagemaptool.c
|
||||
(gimp_image_map_tool_settings_dialog): set the folder using
|
||||
gtk_file_chooser_set_current_folder(), not set_filename().
|
||||
* app/core/gimpimage-undo-push.c (undo_pop_fs_to_layer): factored
|
||||
common code out of the UNDO amd REDO cases. Use gimp_drawable_update()
|
||||
instead of gimp_viewable_invalidate_preview() so the projection
|
||||
gets updated correctly. Fixes bug #149558.
|
||||
|
||||
* app/core/gimplayer-floating-sel.c (floating_sel_to_layer):
|
||||
removed unused variables and their assignments.
|
||||
|
||||
2004-09-24 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimptemplateeditor.[ch]: added a label that shows
|
||||
the pixel size (as in the initial mockup done by Jimmac).
|
||||
|
||||
2004-09-24 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/tools/gimpimagemaptool.c
|
||||
(gimp_image_map_tool_settings_dialog): set the folder using
|
||||
gtk_file_chooser_set_current_folder(), not set_filename().
|
||||
|
||||
2004-09-24 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/curves.[ch]
|
||||
|
|
|
@ -2573,33 +2573,27 @@ undo_pop_fs_to_layer (GimpUndo *undo,
|
|||
gimp_image_set_active_layer (undo->gimage, fsu->floating_layer);
|
||||
undo->gimage->floating_sel = fsu->floating_layer;
|
||||
|
||||
/* restore the contents of the drawable */
|
||||
/* store the contents of the drawable */
|
||||
floating_sel_store (fsu->floating_layer,
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_x,
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_y,
|
||||
GIMP_ITEM (fsu->floating_layer)->width,
|
||||
GIMP_ITEM (fsu->floating_layer)->height);
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_x,
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_y,
|
||||
GIMP_ITEM (fsu->floating_layer)->width,
|
||||
GIMP_ITEM (fsu->floating_layer)->height);
|
||||
fsu->floating_layer->fs.initial = TRUE;
|
||||
|
||||
/* clear the selection */
|
||||
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (fsu->floating_layer));
|
||||
|
||||
/* update the floating layer's name */
|
||||
gimp_object_name_changed (GIMP_OBJECT (fsu->floating_layer));
|
||||
|
||||
/* Update the preview for the gimage and underlying drawable */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (fsu->floating_layer));
|
||||
break;
|
||||
|
||||
case GIMP_UNDO_MODE_REDO:
|
||||
/* restore the contents of the drawable */
|
||||
floating_sel_restore (fsu->floating_layer,
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_x,
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_y,
|
||||
GIMP_ITEM (fsu->floating_layer)->width,
|
||||
GIMP_ITEM (fsu->floating_layer)->height);
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_x,
|
||||
GIMP_ITEM (fsu->floating_layer)->offset_y,
|
||||
GIMP_ITEM (fsu->floating_layer)->width,
|
||||
GIMP_ITEM (fsu->floating_layer)->height);
|
||||
|
||||
/* Update the preview for the gimage and underlying drawable */
|
||||
/* Update the preview for the underlying drawable */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (fsu->floating_layer));
|
||||
|
||||
/* clear the selection */
|
||||
|
@ -2607,16 +2601,17 @@ undo_pop_fs_to_layer (GimpUndo *undo,
|
|||
|
||||
/* update the pointers */
|
||||
fsu->floating_layer->fs.drawable = NULL;
|
||||
undo->gimage->floating_sel = NULL;
|
||||
|
||||
/* update the floating layer's name */
|
||||
gimp_object_name_changed (GIMP_OBJECT (fsu->floating_layer));
|
||||
|
||||
/* Update the fs drawable */
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (fsu->floating_layer));
|
||||
undo->gimage->floating_sel = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_object_name_changed (GIMP_OBJECT (fsu->floating_layer));
|
||||
|
||||
gimp_drawable_update (GIMP_DRAWABLE (fsu->floating_layer),
|
||||
0, 0,
|
||||
GIMP_ITEM (fsu->floating_layer)->width,
|
||||
GIMP_ITEM (fsu->floating_layer)->height);
|
||||
|
||||
gimp_image_floating_selection_changed (undo->gimage);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -194,8 +194,6 @@ floating_sel_to_layer (GimpLayer *layer)
|
|||
{
|
||||
GimpItem *item;
|
||||
GimpImage *gimage;
|
||||
gint off_x, off_y;
|
||||
gint width, height;
|
||||
|
||||
g_return_if_fail (GIMP_IS_LAYER (layer));
|
||||
g_return_if_fail (gimp_layer_is_floating_sel (layer));
|
||||
|
@ -213,6 +211,9 @@ floating_sel_to_layer (GimpLayer *layer)
|
|||
return;
|
||||
}
|
||||
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_FS_TO_LAYER,
|
||||
_("Floating Selection to Layer"));
|
||||
|
||||
/* restore the contents of the drawable */
|
||||
floating_sel_restore (layer,
|
||||
item->offset_x,
|
||||
|
@ -220,15 +221,6 @@ floating_sel_to_layer (GimpLayer *layer)
|
|||
item->width,
|
||||
item->height);
|
||||
|
||||
/* determine whether the resulting layer needs an update */
|
||||
gimp_item_offsets (GIMP_ITEM (layer->fs.drawable), &off_x, &off_y);
|
||||
|
||||
width = gimp_item_width (GIMP_ITEM (layer->fs.drawable));
|
||||
height = gimp_item_height (GIMP_ITEM (layer->fs.drawable));
|
||||
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_FS_TO_LAYER,
|
||||
_("Floating Selection to Layer"));
|
||||
|
||||
gimp_image_undo_push_fs_to_layer (gimage, NULL,
|
||||
layer, layer->fs.drawable);
|
||||
|
||||
|
|
Loading…
Reference in a new issue