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 308710 - Brush outlines have large gaps
Brush outlines have large gaps
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.2.x
Other All
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-06-22 22:40 UTC by Tor Lillqvist
Modified: 2008-01-15 12:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested patch (2.50 KB, patch)
2005-06-22 22:42 UTC, Tor Lillqvist
needs-work Details | Review
Improved patch (6.66 KB, patch)
2005-06-23 01:02 UTC, Tor Lillqvist
accepted-commit_now Details | Review

Description Tor Lillqvist 2005-06-22 22:40:32 UTC
The brush outlines have gaps that occasionally can be quite large. For instance
the outlines of large circular brushes have large gaps at the diagonal
directions. A pathological case is the diamond brush: At angle 0, its outline
doesn't really show at all, which is kinda surprising given the simple form of
the brush.

I will attach a patch that greatly improves this. In most cases the outline is
now drawn solid without gaps, although for some complex brushes there still are
gaps.

Actually, after this patch the brush outline might even be said to look *too*
solid. For complex brushes with holes, it might be a good idea not to draw the
holes, just the outermost boundary. I will try that.
Comment 1 Tor Lillqvist 2005-06-22 22:42:11 UTC
Created attachment 48184 [details] [review]
Suggested patch
Comment 2 Sven Neumann 2005-06-22 23:20:58 UTC
There should be a local non-const variable for bound_segs. Otherwise we get a
compiler warning about freeing a const variable (and we actually change a const
variable which is probably worse).

The outline does indeed turn out to too solid after your patch applied. I also
had the impression that the rendering is slower for large and detailed brushes.
This will probably need more work but if you want to get your changes into CVS,
feel free to commit intermediate versions w/o approval.
Comment 3 Tor Lillqvist 2005-06-23 01:02:55 UTC
Created attachment 48190 [details] [review]
Improved patch

I add a new GimpCanvasStyle GIMP_CANVAS_STYLE_XOR_DOTTED that uses one-pixel
on-off dashes (instead of the default four-pixel dashes that XOR_DASHED uses).
I draw the brush outline using XOR_DOTTED, and using gimp_canvas_draw_lines()
instead of draw_segments(). The brush outline is now nicely dotted.
Comment 4 Michael Schumacher 2005-06-24 08:49:14 UTC
Hole in a brush shouldn't be neglected when drawing the outline - for really
odd-shpaed "hollow" brushes, it is important to know where the holes are when
you use them from stamping.
Comment 5 Tor Lillqvist 2005-06-24 22:22:29 UTC
Patch committed to HEAD.

2005-06-24  Tor Lillqvist  <tml@novell.com>

	* app/display/gimpcanvas.h: Add new GimpCanvasStyle value,
	GIMP_CANVAS_STYLE_XOR_DOTTED.

	* app/display/gimpcanvas.c (gimp_canvas_gc_new): Implement it like
	GIMP_CANVAS_STYLE_XOR_DASHED, except that we set the dash pattern
	to a single-pixel on-off one.

	* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_boundary): Sort
	the boundary so that we can draw each connected group of segments
	using gimp_canvas_draw_lines(). (Even if we would still use
	gimp_canvas_draw_segments(), the boundary would have to be sorted
	so that the XOR drawing and GDK_CAP_NOT_LAST cooperate properly.)

	Use GIMP_CANVAS_STYLE_XOR_DOTTED so the outline doesn't look too
	heavy.

	Remove the dubious code snippet that offset some segments by one
	pixel. It didn't do what the comment claimed, and why one would
	need to do what the comment said, or what it actually did, is
	unclear.

	Now brush outlines shouldn't have gaps any longer. (#308710)