André, I've been trying to make sense of why previewed mathed insets 
no longer appear centred and hit on the idea of using a different 
background colour to visualise the inset's boundaries.

Why does the mathed formula in display mode extend so much beyond the 
editble area? See the snapshots below.

I suspect that this is something of a hack to work around problems in 
the interaction between mathed and the outside world? If so, I don't 
think it is needed anymore. Martin Vermeer has come up with a clean 
solution. See eg insetindex.[Ch]:

class InsetPrintIndex : public InsetCommand {
        ...
        mutable unsigned int center_indent_;
};
        
void InsetPrintIndex::metrics(MetricsInfo & mi, Dimension & dim) const
{
        InsetCommand::metrics(mi, dim);
        center_indent_ = (mi.base.textwidth - dim.wid) / 2;
        dim.wid = mi.base.textwidth;
        dim_ = dim;
}


void InsetPrintIndex::draw(PainterInfo & pi, int x, int y) const
{
                    InsetCommand::draw(pi, x + center_indent_, y);
}

Would this not work for mathed insets too?
Indeed, is there not a case for storing an 'indent' or 'offset' 
variable in Dimension?

-- 
Angus

<<attachment: snapshot1.png>>

<<attachment: snapshot2.png>>

<<attachment: snapshot3.png>>

Reply via email to