Neil Hodgson wrote:
Robert Roessler:
This is probably well known, BUT in the "GTK on Windows" version of
Scintilla, INDIC_BOX is drawn with ugly artifacts (see attached png) -
this is actually why I have been using the much more expensive
INDIC_DIAGONAL. :(
...
Looking at the GDK [line-]drawing attributes being set in PlatGTK.cxx,
everything appears to be as it should... I am left with
1) GDK code doesn't work - unlikely :)
GDK code does work.
http://scintilla.sourceforge.net/BoxIndicator.png
2) GDK rendering on Win32 is broken, at least in this respect
INDIC_BOX is written to work with either last point drawn or last
point not drawn. Windows default behaviour is to not draw the last
point of a line and Scintilla sets GDK to the same behaviour with
gdk_gc_set_line_attributes(gc, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST,
GDK_JOIN_MITER);
If 2) is the case, might this have something to do with the Windows
view of drawing, which says that lines bordering a rect on the RIGHT
and BOTTOM actually are "included" in it (or something like that)?
Looks like GDK is over-compensating on Windows by extending an
extra pixel. Expanding the calls associated with top right:
gdk_draw_line(drawable, gc, rc.right, ymid+1, rc.right, rcLine.top+1);
gdk_draw_line(drawable, gc, rc.right, rcLine.top+1, rc.left, rcLine.top+1);
There is no reason to draw the extra pixel.
Like I said, everything that Scintilla is doing seems to be correct -
so I take it that you are agreeing with me that "GDK on Windows" is
doing something wrong.
In any case, Neil, would you be receptive to a new version (from me)
of Indicator::Draw which reimplemented [at least] INDIC_BOX to work
around this problem? And yes, it requires two more LineTo calls. :(
The patch would have to draw correctly on GTX+ on X as well as on
native Windows. Not being able to depend on gdk_draw_line will affect
more calls than this. You need to be able to depend on the library to
do what you tell it to.
Indeed you *should* be able to depend on the library to do as you
direct it. :)
And since if you deny yourself two drawing directions out of four, it
looks to me like there is always going to be one point (in a
rectangle) where two segments will *finish*... and if the lowest level
rendering routines really do not draw the last point in a line, that
point will go... undrawn. :(
Of course, switching the code to start in the top left, and then draw
DOWN followed by RIGHT, reposition to top left, and draw RIGHT and
then DOWN, my "GTK on Windows" setup draws the rect *perfectly* - but
it shouldn't. :)
Sigh. So I suppose that until the GTK folks fix this, I can either
use INDIC_DIAGONAL which is dog-slow (yes, I know Neil suggested a
possible approach for fixing this) and doesn't look all that cool
anyway, or use INDIC_BOX, which is fast *and* looks cool... unless my
GTK-based app is running on Windows. Sigh again.
Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest