Added extra space to choosing sticker animation in left position.

This commit is contained in:
23rd 2021-09-11 17:15:40 +03:00
parent a5be9d78d8
commit fa4b7145f5
3 changed files with 13 additions and 1 deletions

View File

@ -309,7 +309,7 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) {
// FontData::spacew for more precise calculation.
const auto mf = QFontMetricsF(_st.font->f);
_spacesCount = std::round(
_sendActionAnimation.width()
_sendActionAnimation.widthNoMargins()
/ mf.horizontalAdvance(' '));
}
newTypingString = newTypingString.replace(

View File

@ -38,6 +38,9 @@ public:
bool supports(Type type) const;
virtual int width() const = 0;
virtual int widthNoMargins() const {
return width();
}
virtual void paint(
Painter &p,
style::color color,
@ -520,6 +523,10 @@ public:
}
int width() const override {
return widthNoMargins() + _eye.step * 2;
}
int widthNoMargins() const override {
return st::historySendActionChooseStickerPosition.x()
+ 2 * (_eye.outWidth + _eye.step)
+ _eye.step;
@ -681,6 +688,10 @@ int SendActionAnimation::width() const {
return _impl ? _impl->width() : 0;
}
int SendActionAnimation::widthNoMargins() const {
return _impl ? _impl->widthNoMargins() : 0;
}
void SendActionAnimation::paint(
Painter &p,
style::color color,

View File

@ -25,6 +25,7 @@ public:
void tryToFinish();
int width() const;
int widthNoMargins() const;
void paint(
Painter &p,
style::color color,