mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Be careful about accounting for the right margin
In computeRowMetrics, the right margin of the row shall be taken in account when the text is not left-aligned. Rewrite the code in terms of the available width `w' to avoid this pitfall.
This commit is contained in:
parent
1663dbcbcf
commit
89dca6d3a9
@ -590,10 +590,10 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
|
||||
if (ns && !row.right_boundary()
|
||||
&& row.endpos() != par.size()) {
|
||||
row.setSeparatorExtraWidth(double(w) / ns);
|
||||
row.dimension().wid = width;
|
||||
row.dimension().wid += w;
|
||||
} else if (text_->isRTL(par)) {
|
||||
row.dimension().wid = width;
|
||||
row.left_margin += w;
|
||||
row.dimension().wid += w;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -602,7 +602,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
|
||||
row.dimension().wid += w;
|
||||
break;
|
||||
case LYX_ALIGN_CENTER:
|
||||
row.dimension().wid = width - w / 2;
|
||||
row.dimension().wid += w / 2;
|
||||
row.left_margin += w / 2;
|
||||
break;
|
||||
case LYX_ALIGN_LEFT:
|
||||
|
Loading…
Reference in New Issue
Block a user