[XForms] XForms text rendering bug patch
Angus Leeming
angus.leeming at btopenworld.com
Wed May 5 10:41:13 EDT 2004
On Tuesday 02 March 2004 2:41 pm, Jean-Marc Lasgouttes wrote:
> >>>>> "Dmitry" == Dmitry Karasik <dmitry at karasik.eu.org> writes:
> Dmitry> Under certain condition,
> Dmitry> input lines do not display any text. The bug, which is
> Dmitry> basically comparison of a signed integer as a boolean, is
> Dmitry> fixed by the following patch:
> Hello,
> Thanks for the patch. I think we are suffering from this bug in LyX
> in some circumstances, but we never got to fix it.
Can you expand further?
> Are you sure that your fix is the right one? I do not know this
> part of code at all, but the comment before the function says:
> /* Major text drawing routine
> * clip == 0: no clipping
> * clip == 1: do clipping here
> * clip == -1: clipping is done outside of this routine
> */
> so testing for clip as a boolean means 'if there is some clipping
> going on somewhere', which may be a reasonable test. Are you sure
> that only the 'do clipping here' case should be handled?
Jean-Marc, I've been reading the code. (clip == -1) is used only by
the input.c routine draw_input
I read this:
if (clip && (starty[i] + flx->fdesc) > y + h)
continue;
as saying
"if clipping and if the position of the baseline + the font descent
is greater than the bottom of the widget then loop.
I also see that this command is the only place in the routine that
mentions clip and which does not qualify it with (clip > 0). In fact,
all they are used for elsewhere is:
if (clip > 0)
fl_set_text_clipping();
if (clip > 0)
fl_unset_text_clipping();
Conclusion, it's meant and should stay.
Angus
More information about the Xforms
mailing list