On Wed, Jun 28, 2006 at 03:06:36PM +0200, Jean-Marc Lasgouttes wrote:
> >>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
> 
> Jean-Marc> This is because the rowpainter code sets Wide() on these
> Jean-Marc> insets, because they are alone on a row. The following
> Jean-Marc> patches test additionally that the inset is not the last
> Jean-Marc> element of the paragraph. It seems to work for me, but I am
> Jean-Marc> not sure it is the right condition to test.

No, I have serious doubts here. And there will be situations where an
inset is the last (or only) element of a paragraph, and contains lots of
texts that we want to render parsimoniously. So I am afraid that this
subverts the speed-up effect.

> Here is an updated version of these patches. What is new here is
> 
> - I decreased the right margin from 30 to 10 (this is independent and
>   can go in now, I think).

Yes, agreed, contingent on testing.
 
> - openinlined_ can only be set to true when the inset contains only
>   one row. This was a cause for some strange behaviors.

Does this really work correctly for, e.g., a note inset inside a
tabular? (I assume you tested this patch without my patch, i.e. against
pristine svn). I would expect the right edge of the note to overflow the
cell border, due to the metric being calculated for openinlined_ =
false, but then drawn with openinlined_ = true.

(And I don't see how you can ever achieve sane rendering of
notes-inside-tabulars without some changes to insettabular.C like the
ones I have proposed (although I believe that two metrics calls are not
necessary if you play your cards right)

> What I _really_ wanted to do is to force the text inset width to be
> mi.base.textwidth_ when openinlined_ is false (the width is currently
> the natural width of the inset, and I do not like that, since it
> changes when typing). 

Precisely. You want it to be constant.

> However, I failed to find how this can be done.

The problem is that when the metric is computed, mi.base.textwidth is 
uninitialized, which is interpreted as the working width of the text
(search for maxwidth_ in text.C and text2.C). This means that
openinlined_ will be set to false, and the metric is based on that.

> I am sure it is possible (the main text inset enforces its width, for
> example). Martin, do you know how to do that?

Hmmm. No. I would take the path of eliminating mi.base.textwidth from
the definition of openinlined_. Then the note inset won't change width
inbetween metrics and drawing. E.g.

openinlined_ = textdim_.wid < 0.5 * mi.base.bv->workWidth();

> I'd really appreciate testing of this patches.

I'm really short on time right now... and off to the country again.

- Martin
 

Attachment: pgp3XXF5uSBFC.pgp
Description: PGP signature

Reply via email to