app: behave as if "show all" is disabled in edit/buffers/DnD actions when keeping padding

This commit is contained in:
Ell
2019-09-15 16:25:20 +03:00
parent f7582614f4
commit 6088a747c0
3 changed files with 22 additions and 12 deletions

View File

@ -74,8 +74,10 @@ buffers_paste_cmd_callback (GimpAction *action,
{ {
GimpDisplayShell *shell = gimp_display_get_shell (display); GimpDisplayShell *shell = gimp_display_get_shell (display);
gimp_display_shell_untransform_viewport (shell, ! shell->show_all, gimp_display_shell_untransform_viewport (
&x, &y, &width, &height); shell,
! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
image = gimp_display_get_image (display); image = gimp_display_get_image (display);
} }

View File

@ -609,8 +609,10 @@ edit_paste (GimpDisplay *display,
/* the actual paste-type conversion happens in gimp_edit_paste() */ /* the actual paste-type conversion happens in gimp_edit_paste() */
} }
gimp_display_shell_untransform_viewport (shell, ! shell->show_all, gimp_display_shell_untransform_viewport (
&x, &y, &width, &height); shell,
! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
if (gimp_edit_paste (image, drawable, paste, if (gimp_edit_paste (image, drawable, paste,
paste_type, x, y, width, height)) paste_type, x, y, width, height))

View File

@ -179,8 +179,10 @@ gimp_display_shell_dnd_position_item (GimpDisplayShell *shell,
gint x, y; gint x, y;
gint width, height; gint width, height;
gimp_display_shell_untransform_viewport (shell, ! shell->show_all, gimp_display_shell_untransform_viewport (
&x, &y, &width, &height); shell,
! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
off_x = x + (width - item_width) / 2; off_x = x + (width - item_width) / 2;
off_y = y + (height - item_height) / 2; off_y = y + (height - item_height) / 2;
@ -496,8 +498,10 @@ gimp_display_shell_drop_buffer (GtkWidget *widget,
buffer = GIMP_BUFFER (viewable); buffer = GIMP_BUFFER (viewable);
gimp_display_shell_untransform_viewport (shell, ! shell->show_all, gimp_display_shell_untransform_viewport (
&x, &y, &width, &height); shell,
! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
/* FIXME: popup a menu for selecting "Paste Into" */ /* FIXME: popup a menu for selecting "Paste Into" */
@ -569,10 +573,12 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
gint height = gimp_image_get_height (image); gint height = gimp_image_get_height (image);
if (gimp_display_get_image (shell->display)) if (gimp_display_get_image (shell->display))
gimp_display_shell_untransform_viewport (shell, {
! shell->show_all, gimp_display_shell_untransform_viewport (
&x, &y, shell,
&width, &height); ! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
}
gimp_image_add_layers (image, new_layers, gimp_image_add_layers (image, new_layers,
GIMP_IMAGE_ACTIVE_PARENT, -1, GIMP_IMAGE_ACTIVE_PARENT, -1,