mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 10:47:57 +00:00
Fix left margin with some nested layouts (#9538)
This commit is contained in:
parent
34da634451
commit
5f20d05b1b
@ -1610,12 +1610,16 @@ int TextMetrics::leftMargin(int max_width,
|
|||||||
l_margin += theFontMetrics(buffer.params().getFont()).signedWidth(
|
l_margin += theFontMetrics(buffer.params().getFont()).signedWidth(
|
||||||
tclass.leftmargin());
|
tclass.leftmargin());
|
||||||
|
|
||||||
if (par.getDepth() != 0) {
|
int depth = par.getDepth();
|
||||||
|
if (depth != 0) {
|
||||||
// find the next level paragraph
|
// find the next level paragraph
|
||||||
pit_type newpar = text_->outerHook(pit);
|
pit_type newpar = text_->outerHook(pit);
|
||||||
if (newpar != pit_type(pars.size())) {
|
if (newpar != pit_type(pars.size())) {
|
||||||
if (pars[newpar].layout().isEnvironment()) {
|
if (pars[newpar].layout().isEnvironment()) {
|
||||||
l_margin = leftMargin(max_width, newpar);
|
int nestmargin = depth * nestMargin();
|
||||||
|
if (text_->isMainText())
|
||||||
|
nestmargin += changebarMargin();
|
||||||
|
l_margin = max(leftMargin(max_width, newpar), nestmargin);
|
||||||
// Remove the parindent that has been added
|
// Remove the parindent that has been added
|
||||||
// if the paragraph was empty.
|
// if the paragraph was empty.
|
||||||
if (pars[newpar].empty() &&
|
if (pars[newpar].empty() &&
|
||||||
|
Loading…
Reference in New Issue
Block a user