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.

> 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.

   Neil

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

Reply via email to