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()) {
|
if (!mediaDisplayed && bubble && hasVisibleText()) {
|
||||||
const auto probeTextWidth = bubbleTextWidth(contentWidth);
|
const auto probeTextWidth = bubbleTextWidth(contentWidth);
|
||||||
[[maybe_unused]] const auto probeHeight = textHeightFor(probeTextWidth);
|
[[maybe_unused]] const auto probe = textHeightFor(probeTextWidth);
|
||||||
if (!Get<TextAppearing>()) {
|
if (!Get<TextAppearing>()) {
|
||||||
const auto use = textRealWidth();
|
const auto use = textRealWidth();
|
||||||
if (use > 0) {
|
if (use > 0) {
|
||||||
@@ -5439,7 +5439,7 @@ bool Message::textAppearCheckLine(not_null<TextAppearing*> appearing) {
|
|||||||
if (appearing->heightAnimation.animating()
|
if (appearing->heightAnimation.animating()
|
||||||
|| !appearing->widthAnimation.animating()
|
|| !appearing->widthAnimation.animating()
|
||||||
|| left <= duration) {
|
|| left <= duration) {
|
||||||
textAppearStartHeightAnimation(appearing);
|
textAppearStartHeightAnimation(appearing, targetHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5477,13 +5477,12 @@ void Message::textAppearStartWidthAnimation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Message::textAppearStartHeightAnimation(
|
void Message::textAppearStartHeightAnimation(
|
||||||
not_null<TextAppearing*> appearing) {
|
not_null<TextAppearing*> appearing,
|
||||||
|
int targetHeight) {
|
||||||
Expects(appearing->use);
|
Expects(appearing->use);
|
||||||
|
|
||||||
const auto from = appearing->shownHeight;
|
const auto from = appearing->shownHeight;
|
||||||
const auto to
|
const auto to = appearing->targetHeight = targetHeight;
|
||||||
= appearing->targetHeight
|
|
||||||
= textAppearTargetHeight(appearing);
|
|
||||||
const auto duration = appearing->finalizing
|
const auto duration = appearing->finalizing
|
||||||
? kLineHeightAppearFinalDuration
|
? kLineHeightAppearFinalDuration
|
||||||
: kLineHeightAppearDuration;
|
: kLineHeightAppearDuration;
|
||||||
@@ -5496,7 +5495,7 @@ int Message::textAppearTargetHeight(
|
|||||||
not_null<TextAppearing*> appearing) const {
|
not_null<TextAppearing*> appearing) const {
|
||||||
const auto next = appearing->shownLine + 1;
|
const auto next = appearing->shownLine + 1;
|
||||||
const auto lines = int(appearing->lines.size());
|
const auto lines = int(appearing->lines.size());
|
||||||
if (next >= lines) {
|
if (next + 1 >= lines) {
|
||||||
return appearing->lines.back().bottom;
|
return appearing->lines.back().bottom;
|
||||||
}
|
}
|
||||||
const auto &line = appearing->lines[next];
|
const auto &line = appearing->lines[next];
|
||||||
|
|||||||
@@ -397,7 +397,9 @@ private:
|
|||||||
bool textAppearValidate(not_null<TextAppearing*> appearing);
|
bool textAppearValidate(not_null<TextAppearing*> appearing);
|
||||||
bool textAppearCheckLine(not_null<TextAppearing*> appearing);
|
bool textAppearCheckLine(not_null<TextAppearing*> appearing);
|
||||||
void textAppearStartWidthAnimation(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 textAppearWidthCallback();
|
||||||
void textAppearHeightCallback();
|
void textAppearHeightCallback();
|
||||||
[[nodiscard]] int textAppearTargetHeight(
|
[[nodiscard]] int textAppearTargetHeight(
|
||||||
|
|||||||
Reference in New Issue
Block a user