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 116765 - Display artifacts when dragging a selection
Display artifacts when dragging a selection
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal minor
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2003-07-05 16:41 UTC by Pedro Gimeno
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of the problem described in bug #116765 (10.92 KB, image/png)
2003-11-25 21:37 UTC, Pedro Gimeno
  Details
Patch that might fix bug #116765 (963 bytes, patch)
2003-11-30 12:40 UTC, Pedro Gimeno
none Details | Review

Description Pedro Gimeno 2003-07-05 16:41:57 UTC
Part of the image is not moved (or some trails are left) under certain
conditions while dragging a selection.

Steps to reproduce:

1. Create a 10x100 image and fill it with default black FG color, or load
one with many colors.
2. Zoom to 5:1.
3. Edit->Select All.
4. Scroll to the bottom of the image.
5. Drag the selection down a few pixels, then right a few pixels.
6. Scroll to about y=64 and see some pixels that should be white or
transparent but are black or copied from the image being dragged.

It's a display artifact only. Undo+Redo solves the problem. The exact
position where the artifact appears depends on the zoom ratio among other
things, and the height of the band depends on how much the selection was
moved down before moving it right (or left). If the selection is moved up
instead of down in step 5, nothing strange seems to happen.
Comment 1 Alan Horkan 2003-07-23 18:39:54 UTC
Changes at the request of Dave Neary on the developer mailing list.  
I am changing many of the bugzilla reports that have not specified a target
milestone to Future milestone.  Hope that is acceptable.  
Comment 2 Tino Schwarze 2003-07-24 07:00:23 UTC
Can be reproduced with 1.3.16 - do not resize the image window, just
use the initial size. There stays a black rectangle at around y=64.
Creating a new transparent layer gets rid of it.
Comment 3 Sven Neumann 2003-11-11 22:04:50 UTC
Is this still reproducable? I assume that the menubar needs to be
switched off. Is that correct?
Comment 4 Pedro Gimeno 2003-11-12 18:45:52 UTC
Yes, it's still reproducable with yesterday's CVS version either with
or without a menubar. What worries me about this problem is where the
data that isn't written where it should is actually written.

Additional note to reproduce it: don't touch the original window
height, or do a shrink wrap (^E) right after creating it, but don't
enlarge the window vertically during the rest of the steps. Of course
step 3 should read: "Select->All" and not "Edit->Select All".
Comment 5 Sven Neumann 2003-11-12 19:09:37 UTC
Why haven't I been able to reproduce it then? Perhaps I just didn't
try hard enough...
Comment 6 Sven Neumann 2003-11-25 17:24:28 UTC
Is still still reproducable after Mitch fixed bug #126942 ?
Comment 7 Pedro Gimeno 2003-11-25 21:35:16 UTC
Yes, it's still reproducable. Note that this is not an exposure
problem at all - indeed the wrong part is not visible until you scroll
up. It's unaltered by zoom changes. The color picker does not see the
wrong data. Manually calling gimp-drawable-update from the Script-Fu
console gets rid of the artifacts as well, but a call to
gimp-displays-flush doesn't.

Additional note: the same problem happens if the full layer is moved
instead of the selection using the move tool (no need to fill it black
in that case).

To make it clear, here's another step-by-step guide on how to
reproduce it:

1. Create an image, width = 10, height = 100
2. Shrink wrap (^E).
3. Zoom to 500%. Don't resize the window (the Resize Window on Zoom
option in the preferences should be disabled).
4. Scroll down to the BOTTOM of the image. The lower border should be
visible at this point, and the upper should be hidden.
5. Select the Move tool. Be sure that the Transform Layer tool option
is active.
6. Drag the layer diagonally down and to the right about 45 degrees,
until (say) about 2/3 of the layer are off the image boundaries.
7. Scroll up to about y=64.

I'm attaching a screenshot to show the result.
Comment 8 Pedro Gimeno 2003-11-25 21:37:31 UTC
Created attachment 21809 [details]
Screenshot of the problem described in bug #116765
Comment 9 Pedro Gimeno 2003-11-30 12:39:00 UTC
The following patch works for me. However I'm far from being confident
that it is valid or even that it doesn't break anything, and so I'd
like to see it reviewed for correctness before committing it.

As a tip for reviewers, this patch makes the value of "starty" be 64
on every call to gimp_image_construct() instead of letting it change
(65, 66, 67,...) as the layer position changes when following the
steps needed to reproduce this bug.

Note also that the same problem could be reproduced horizontally by
following the same steps but transposed (shrinking the window in the X
dimension was necessary to see the effect).
Comment 10 Pedro Gimeno 2003-11-30 12:40:13 UTC
Created attachment 21938 [details] [review]
Patch that might fix bug #116765
Comment 11 Michael Natterer 2004-01-12 11:12:52 UTC
Fixed in CVS:

2004-01-12  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-projection.c (gimp_image_invalidate): applied
	patch from Pedro Gimeno that makes sure we always invalidate
	complete tiles, not parts of it. Fixes bug #116765.

	* app/display/gimpdisplay.c (gimp_display_paint_area): calculate
	the image area to invalidate using sub-pixel precision and
	ceil()/floor() the resulting area to make sure we always
	invalidate a superset of the dirty area, not a subset. A rounding
	error here has never been reported but would cause effects similar
	to #116765.