[RTL] Fix fill align and trim with enabled dropcap.
(cherry picked from commit efa647bb17
)
This commit is contained in:
parent
a5572ba5a3
commit
2c80ded6ce
|
@ -233,27 +233,27 @@ void TextParagraph::_shape_lines() {
|
||||||
}
|
}
|
||||||
if (alignment == HORIZONTAL_ALIGNMENT_FILL) {
|
if (alignment == HORIZONTAL_ALIGNMENT_FILL) {
|
||||||
for (int i = 0; i < (int)lines_rid.size(); i++) {
|
for (int i = 0; i < (int)lines_rid.size(); i++) {
|
||||||
|
float line_w = (i <= dropcap_lines) ? (width - h_offset) : width;
|
||||||
if (i < visible_lines - 1 || (int)lines_rid.size() == 1) {
|
if (i < visible_lines - 1 || (int)lines_rid.size() == 1) {
|
||||||
TS->shaped_text_fit_to_width(lines_rid[i], width, jst_flags);
|
TS->shaped_text_fit_to_width(lines_rid[i], line_w, jst_flags);
|
||||||
} else if (i == (visible_lines - 1)) {
|
} else if (i == (visible_lines - 1)) {
|
||||||
TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], width, overrun_flags);
|
TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], line_w, overrun_flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (lines_hidden) {
|
} else if (lines_hidden) {
|
||||||
TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], width, overrun_flags);
|
TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], (visible_lines - 1 <= dropcap_lines) ? (width - h_offset) : width, overrun_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Autowrap disabled.
|
// Autowrap disabled.
|
||||||
for (const RID &line_rid : lines_rid) {
|
for (int i = 0; i < (int)lines_rid.size(); i++) {
|
||||||
|
float line_w = (i <= dropcap_lines) ? (width - h_offset) : width;
|
||||||
if (alignment == HORIZONTAL_ALIGNMENT_FILL) {
|
if (alignment == HORIZONTAL_ALIGNMENT_FILL) {
|
||||||
TS->shaped_text_fit_to_width(line_rid, width, jst_flags);
|
TS->shaped_text_fit_to_width(lines_rid[i], line_w, jst_flags);
|
||||||
overrun_flags.set_flag(TextServer::OVERRUN_JUSTIFICATION_AWARE);
|
overrun_flags.set_flag(TextServer::OVERRUN_JUSTIFICATION_AWARE);
|
||||||
TS->shaped_text_overrun_trim_to_width(line_rid, width, overrun_flags);
|
TS->shaped_text_overrun_trim_to_width(lines_rid[i], line_w, overrun_flags);
|
||||||
TS->shaped_text_fit_to_width(line_rid, width, jst_flags | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS);
|
TS->shaped_text_fit_to_width(lines_rid[i], line_w, jst_flags | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS);
|
||||||
} else {
|
} else {
|
||||||
TS->shaped_text_overrun_trim_to_width(line_rid, width, overrun_flags);
|
TS->shaped_text_overrun_trim_to_width(lines_rid[i], line_w, overrun_flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue