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 631106 - Replace diagonal striped stipple pattern for marching ants with checkerboard
Replace diagonal striped stipple pattern for marching ants with checkerboard
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2010-10-01 15:16 UTC by Mukund Sivaraman
Modified: 2018-05-24 12:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Replace diagonal striped stipple pattern for marching ants with checkerboard (1.09 KB, patch)
2010-10-01 15:17 UTC, Mukund Sivaraman
none Details | Review
Badly stroked selection (master) (1.61 KB, image/png)
2010-10-01 15:27 UTC, Mukund Sivaraman
  Details
Badly stroked selections (2.6) (7.82 KB, image/png)
2010-10-01 15:28 UTC, Mukund Sivaraman
  Details
Better stroked selections (checkerboard pattern) (7.03 KB, image/png)
2010-10-01 15:35 UTC, Mukund Sivaraman
  Details
Patch updated for current code location (1.22 KB, patch)
2016-12-30 22:59 UTC, Michael Schumacher
none Details | Review

Description Mukund Sivaraman 2010-10-01 15:16:04 UTC
Replace diagonal striped stipple pattern for marching ants with checkerboard pattern.

I'm creating this bug so that my patch and explanation aren't lost. Will add them in the comments.
Comment 1 Mukund Sivaraman 2010-10-01 15:17:26 UTC
Created attachment 171500 [details] [review]
[PATCH] Replace diagonal striped stipple pattern for marching ants with checkerboard

 app/widgets/gimpcairo.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
Comment 2 Mukund Sivaraman 2010-10-01 15:25:48 UTC
Currently, the stipple pattern for marching ants has diagonal stripes. It is used as a cairo source, and selection outline is stroked using the pattern using cairo_mask(). The selection outline becomes a mask, where opaque regions are rendered using the pattern below and transparent regions are not.

The stipple pattern is as follows:

  01234567
0 xxxx
1 xxx    x
2 xx    xx
3 x    xxx
4     xxxx
5    xxxx
6   xxxx
7  xxxx

An index is also used to rotate the pattern diagonally from the top-left corner to the bottom-right corner (and hence march the ants).

This works fine and dandy, except for the case where you have selections of 40 - 50 degrees when zoomed out. In that case, a lot of the time, there is no outline shown because the pattern is empty there.

Screenshot of this effect is coming up.
Comment 3 Mukund Sivaraman 2010-10-01 15:27:18 UTC
Created attachment 171503 [details]
Badly stroked selection (master)
Comment 4 Mukund Sivaraman 2010-10-01 15:28:35 UTC
Created attachment 171504 [details]
Badly stroked selections (2.6)

This effect is seen in 2.6 as well. But because the stipple pattern is mirrored, the effect is seen in selection edges around 135 degrees.
Comment 5 Mukund Sivaraman 2010-10-01 15:35:03 UTC
Created attachment 171507 [details]
Better stroked selections (checkerboard pattern)

The patch moves to a checkerboard pattern. With this, there is an improvement in the way the selection can be seen more clearly.

A side-effect of this patch is that the ants are not marching so smoothly anymore. They appear to jump. But I still think this patch should go in, as the current state is worse. In any case, you are not going to see smoothly marching ants in the curves of selections when zoomed out with any stipple pattern when using this cairo_mask() method.

It is very difficult to come up with good patterns because of the way they are used with the selection outline as a mask. The perfect selection stroking would of course be to walk and stroke the selection edges and maybe even reduce the selection geometry.. but this would not perform as well as the cairo method used now, or is not so simple.
Comment 6 Mukund Sivaraman 2010-10-01 15:36:57 UTC
I also proposed to Mitch that we could adopt a hybrid approach, where, when we are zoomed in and can see only manhattan selection edges around individual pixels, we use the diagonal stipple pattern, and when we are zoomed out, we use the checkerboard pattern.
Comment 7 Michael Natterer 2016-05-26 03:15:52 UTC
Muks, thing bug has only your comments :) soI have no idea any more
why I proposed that... I think it just looked weird in my tests?
Comment 8 Michael Schumacher 2016-12-30 22:59:05 UTC
Created attachment 342647 [details] [review]
Patch updated for current code location
Comment 9 GNOME Infrastructure Team 2018-05-24 12:51:09 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/342.