修复文本计算下降部分计算不正确
This commit is contained in:
parent
c79167eb93
commit
fb46da91d4
@ -170,7 +170,7 @@ text_layout_t font_manager::layout_text(
|
||||
|
||||
// 更新当前行的度量信息
|
||||
current_line.ascent = std::max(current_line.ascent, current_metrics.ascent);
|
||||
current_line.descent = std::min(current_line.descent, current_metrics.descent);
|
||||
current_line.descent = std::max(current_line.descent, std::abs(current_metrics.descent));
|
||||
current_line.height = std::max(current_line.height, current_metrics.line_height);
|
||||
|
||||
// 计算基线位置 - 基于当前行的上升距离
|
||||
@ -209,7 +209,7 @@ text_layout_t font_manager::layout_text(
|
||||
}
|
||||
|
||||
// 考虑最后一行的下降部分
|
||||
height -= std::abs(current_line.descent);
|
||||
height -= current_line.descent;
|
||||
|
||||
// 处理最后一行
|
||||
finish_line();
|
||||
|
Loading…
x
Reference in New Issue
Block a user