GNOME Bugzilla – Bug 78732
don't paste off screen
Last modified: 2004-01-15 14:37:08 UTC
Zoom in pretty far on an image so you have scrollbars. Scroll all the way over to the top left of the canvas. Select. Copy. Paste. The pasted thing appears were the selection was. So far so good. Discard the selection. Paste. The pasted thing has appeared in the exact center of the canvas, which is way the hell off the screen. When things are pasted, they should never appear off screen -- paste them in the center of the visible viewport, not in the center of the canvas.
This issue was mentioned during GUADEC 3 and reported last week on the gimp-developer mailing list. Here is a quote from Sven's message: > - Find a better heuristic to place pasted selections/layers. Right > now they appear in the center of the image which is often far > away from the spot where one needs them. Using the center of the > display could be a better choice.
*** Bug 81639 has been marked as a duplicate of this bug. ***
I highly agree - this makes any editing where one is trying to paste and place small objects with pixel accuracy a total pain. (You have to keep zooming in and out to get the pasted object, or scroll to it and drag it back, which is often awkward.) Just putting the pasted object in the centre of the current view would be fine, and it can't possibly be hard to implement.
It is not difficult but since the behaviour should not change dramatically from the current behaviour it is not trivial neither. I have some related changes in my tree that I will commit soon.
Changing milestone on a bunch of bugs to 2.0 - none of these could be considered a blocker for a pre-release, IMHO. Many of these have patches or someone working on them, but they're not urgent. Dave.
What is the status of this bug report? Sven, did you commit the related changes?
As you you can easily verify the problem is still there. No attempts have been made to fix this.
Fixed in CVS: 2004-01-15 Michael Natterer <mitch@gimp.org> Fixed bug #78732 (don't paste off screen): * app/display/gimpdisplayshell-transform.[ch]: added new function gimp_display_shell_untransform_viewport() which returns the visible rectangle of the image in image coordinates. * app/core/gimp-edit.[ch] (gimp_edit_paste): added viewport parameters and changed positioning of the pasted layer as follows: - if there is a selection, center on the selection (just as before). - if there is no viewport, center on the active drawable. - if the viewport intersects with the active drawable, center on the intersection. - if the viewport does *not* intersect with the active drawable, center on the active drawable (off-screen, but better than pasting something that will be invisible due to floating selection clipping). - if there is no active drawable, center on the viewport. - if there is no active drawable and no viewport, center on the image. * app/widgets/gimpbufferview.c (gimp_buffer_view_paste_clicked) (gimp_buffer_view_paste_into_clicked) * app/display/gimpdisplayshell-dnd.c (gimp_display_shell_drop_buffer) * app/gui/edit-commands.c (edit_paste_cmd_callback) (edit_paste_into_cmd_callback): ask the shell for the viewport and pass it to gimp_edit_paste(). * app/display/gimpdisplayshell-dnd.c (gimp_display_shell_drop_drawable): center the created layer on the viewport. * app/tools/gimpmovetool.c (gimp_move_tool_button_release): use gimp_display_shell_untransform_viewport() (its code was taken from here). * tools/pdbgen/pdb/edit.pdb: pass "no viewport" to gimp_edit_paste(). * app/pdb/edit_cmds.c: regenerated.