mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Linearize macros also when editing them
In the case of inline editing, this avoids unpleasant jumping issues. This may requires to enter monochrome mode before painting the macro elements.
This commit is contained in:
parent
602b858eee
commit
f86dacc292
@ -303,8 +303,12 @@ bool MathMacro::addToMathRow(MathRow & mrow, MetricsInfo & mi) const
|
||||
// This is the same as what is done in metrics().
|
||||
d->editing_[mi.base.bv] = editMode(mi.base.bv);
|
||||
|
||||
// For now we do not linearize in the following cases (can be improved)
|
||||
// - display mode different from normal
|
||||
// - editing with parameter list
|
||||
// - editing with box around macro
|
||||
if (displayMode() != MathMacro::DISPLAY_NORMAL
|
||||
|| d->editing_[mi.base.bv])
|
||||
|| (d->editing_[mi.base.bv] && lyxrc.macro_edit_style != LyXRC::MACRO_EDIT_INLINE))
|
||||
return InsetMath::addToMathRow(mrow, mi);
|
||||
|
||||
/// The macro nesting can change display of insets. Change it locally.
|
||||
|
@ -276,8 +276,13 @@ void MathRow::draw(PainterInfo & pi, int x, int const y) const
|
||||
}
|
||||
case BEG_MACRO:
|
||||
coords.insets().add(e.macro, x, y);
|
||||
|
||||
drawMarkers(pi, e, x, y);
|
||||
if (e.macro->editMetrics(pi.base.bv))
|
||||
pi.pain.enterMonochromeMode(Color_mathbg, Color_mathmacroblend);
|
||||
break;
|
||||
case END_MACRO:
|
||||
if (e.macro->editMetrics(pi.base.bv))
|
||||
pi.pain.leaveMonochromeMode();
|
||||
break;
|
||||
case BEG_ARG:
|
||||
coords.arrays().add(e.ar, x, y);
|
||||
@ -300,7 +305,6 @@ void MathRow::draw(PainterInfo & pi, int x, int const y) const
|
||||
break;
|
||||
}
|
||||
case DUMMY:
|
||||
case END_MACRO:
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user