mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fix text appearing height animation.
This commit is contained in:
@@ -5153,7 +5153,7 @@ int Message::resizeContentGetHeight(int newWidth) {
|
||||
}
|
||||
if (!mediaDisplayed && bubble && hasVisibleText()) {
|
||||
const auto probeTextWidth = bubbleTextWidth(contentWidth);
|
||||
[[maybe_unused]] const auto probeHeight = textHeightFor(probeTextWidth);
|
||||
[[maybe_unused]] const auto probe = textHeightFor(probeTextWidth);
|
||||
if (!Get<TextAppearing>()) {
|
||||
const auto use = textRealWidth();
|
||||
if (use > 0) {
|
||||
@@ -5439,7 +5439,7 @@ bool Message::textAppearCheckLine(not_null<TextAppearing*> appearing) {
|
||||
if (appearing->heightAnimation.animating()
|
||||
|| !appearing->widthAnimation.animating()
|
||||
|| left <= duration) {
|
||||
textAppearStartHeightAnimation(appearing);
|
||||
textAppearStartHeightAnimation(appearing, targetHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5477,13 +5477,12 @@ void Message::textAppearStartWidthAnimation(
|
||||
}
|
||||
|
||||
void Message::textAppearStartHeightAnimation(
|
||||
not_null<TextAppearing*> appearing) {
|
||||
not_null<TextAppearing*> appearing,
|
||||
int targetHeight) {
|
||||
Expects(appearing->use);
|
||||
|
||||
const auto from = appearing->shownHeight;
|
||||
const auto to
|
||||
= appearing->targetHeight
|
||||
= textAppearTargetHeight(appearing);
|
||||
const auto to = appearing->targetHeight = targetHeight;
|
||||
const auto duration = appearing->finalizing
|
||||
? kLineHeightAppearFinalDuration
|
||||
: kLineHeightAppearDuration;
|
||||
@@ -5496,7 +5495,7 @@ int Message::textAppearTargetHeight(
|
||||
not_null<TextAppearing*> appearing) const {
|
||||
const auto next = appearing->shownLine + 1;
|
||||
const auto lines = int(appearing->lines.size());
|
||||
if (next >= lines) {
|
||||
if (next + 1 >= lines) {
|
||||
return appearing->lines.back().bottom;
|
||||
}
|
||||
const auto &line = appearing->lines[next];
|
||||
|
||||
@@ -397,7 +397,9 @@ private:
|
||||
bool textAppearValidate(not_null<TextAppearing*> appearing);
|
||||
bool textAppearCheckLine(not_null<TextAppearing*> appearing);
|
||||
void textAppearStartWidthAnimation(not_null<TextAppearing*> appearing);
|
||||
void textAppearStartHeightAnimation(not_null<TextAppearing*> appearing);
|
||||
void textAppearStartHeightAnimation(
|
||||
not_null<TextAppearing*> appearing,
|
||||
int targetHeight);
|
||||
void textAppearWidthCallback();
|
||||
void textAppearHeightCallback();
|
||||
[[nodiscard]] int textAppearTargetHeight(
|
||||
|
||||
Reference in New Issue
Block a user