After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 78732 - don't paste off screen
don't paste off screen
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
1.x
Other All
: Normal minor
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2002-04-15 08:04 UTC by Jamie Zawinski
Modified: 2004-01-15 14:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jamie Zawinski 2002-04-15 08:04:41 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.
Comment 1 Raphaël Quinet 2002-04-15 09:32:35 UTC
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.
Comment 2 Luis Villa 2002-05-13 16:54:49 UTC
*** Bug 81639 has been marked as a duplicate of this bug. ***
Comment 3 cgibbard 2003-03-23 22:31:45 UTC
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.
Comment 4 Sven Neumann 2003-03-23 22:39:15 UTC
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.
Comment 5 Dave Neary 2003-07-26 20:11:28 UTC
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.
Comment 6 Henrik Brix Andersen 2004-01-09 12:52:26 UTC
What is the status of this bug report? Sven, did you commit the
related changes?
Comment 7 Sven Neumann 2004-01-09 15:21:47 UTC
As you you can easily verify the problem is still there. No attempts
have been made to fix this.
Comment 8 Michael Natterer 2004-01-15 14:37:08 UTC
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.