mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-20 08:03:45 +08:00
Count a line of an article in Ui::Fixed instead of QFixed.
This commit is contained in:
@@ -1822,11 +1822,11 @@ int TextLineHeight(const style::TextStyle &style) {
|
||||
|
||||
int TextLineAscent(const style::TextStyle &style) {
|
||||
if (style.qtextEditLineMetrics) {
|
||||
const auto lineHeight = QFixed(TextLineHeight(style));
|
||||
const auto leading = std::max(style.font->fleading, QFixed());
|
||||
const auto lineHeight = Ui::Fixed(TextLineHeight(style));
|
||||
const auto leading = std::max(style.font->fleading, Ui::Fixed());
|
||||
return std::clamp(
|
||||
(lineHeight * 4 / 5) - leading,
|
||||
QFixed(),
|
||||
Ui::Fixed(),
|
||||
lineHeight).toInt();
|
||||
}
|
||||
const auto lineHeight = TextLineHeight(style);
|
||||
|
||||
Reference in New Issue
Block a user