Christian wrote:
> > > Bram,
> > > I noticed, when displaying icon signs in the gui version of Vim there
> > > might be a small line not overdrawn by the sign, caused by the
> > > 'linespace' setting set to be one. That does look rather ugly, if you
> > > display several signs side by side (see attached screenshot).
> >
> > Do you mean that the dark line below the "+" sign should not be there?
> > And if 'linespace' is set to zero that black line is indeed gone?
>
> It goes away, if I set linespace to -1. But that has other screen
> problems.
> >
> > > Here is a patch. A couple of comments:
> > > 1) I am not sure, why a call to gdk_draw_rectangle() is done in the
> > > existing code. I have left it out as it seems to be unnecessary
> >
> > I believe this is needed to first clear the area with the background
> > color, in case the icon drawn is smaller than the available space.
> > Perhaps you can try it with a rectangular icon, vertically and
> > horizontally. E.g. something like a red exclamation mark. There would
> > need to be some other sign at first to see any effect.
>
> I used an rectangular icon. But you are right, this was probably done
> for making sure, transparent icons are drawn correctly. I thought about
> using transparent signs, but I don not want to use different icons for
> different builts (e.g. png for GTK and bmp for Windows), so I usually
> use the same icon everywhere.
> >
> > > 2) not sure, why a height of 127 was hard coded when drawing the size
> > > area. I have used the actual sign size for that
> >
> > The 127 is the value for "alpha_threshold". At least according to the
> > documentation I found.
>
> Ah my bad, I got confused by the non_alpha function.
> >
> > > 3) when the sign hight differs from the char_height, it will always be
> > > rescaled. This of course has the additional disadvantage of causing a
> > > performance issue. Not sure, if this is noticeable, though.
> >
> > I don't think we should worry about performance.
> >
> > It appears that after your change the aspect ratio of the sign is not
> > kept. Although that would be OK for filling the gap, if the sign was
> > really a different shape it would look weird. In your specific case you
> > would want the sign to fill the available space and probably don't care
> > about keeping the aspect ratio. Adding a setting for this woule make it
> > complicated...
> >
> > How about this: if we can fill the available space with a slightly
> > different ascpect ratio, e.g., 10% different, filling the gap is nicer
> > than the slightly different aspect ratio. If we change the aspect ratio
> > more than 10% or so the icon will start looking weird and we stick to
> > the aspect ratio and as a result there will be a gap (either vertically
> > or horizontally).
> >
> > The names are a bit confusing, SIGN_ASPECT actually means the aspect
> > ratio of the space availeble, with "aspect" is the aspect ratio of the
> > sign being drawn.
> >
> > This also very much depends on the font size, since the space used for
> > the icon is two character cells wide and one character cell plus
> > 'linespace' high.
>
> Okay, how about the attached patch (it allows 15% deviation to the
> aspect ratio (so one can change linespace value by at most 2 for a sign
> of 16x16 pixel and the sign will be completely filled)
That sounds good. I'll have a better look later.
--
GALAHAD: No. Look, I can tackle this lot single-handed!
GIRLS: Yes, yes, let him Tackle us single-handed!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.