Fixed updating of left userpic with offset from swipe-on-reply.

This commit is contained in:
23rd 2024-09-04 16:04:42 +03:00 committed by John Preston
parent 52e42f23ab
commit 5bd45e9a20
2 changed files with 22 additions and 4 deletions

View file

@ -1235,10 +1235,19 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
// paint the userpic if it intersects the painted rect
if (userpicTop + st::msgPhotoSize > clip.top()) {
const auto item = view->data();
const auto hasTranslation = _gestureHorizontal.translation
&& (_gestureHorizontal.msgBareId == item->fullId().msg.bare);
const auto hasTranslation = context.gestureHorizontal.translation
&& (context.gestureHorizontal.msgBareId
== item->fullId().msg.bare);
if (hasTranslation) {
p.translate(_gestureHorizontal.translation, 0);
p.translate(context.gestureHorizontal.translation, 0);
update(
QRect(
st::historyPhotoLeft
+ context.gestureHorizontal.translation,
userpicTop,
st::msgPhotoSize
- context.gestureHorizontal.translation,
st::msgPhotoSize));
}
if (const auto from = item->displayFrom()) {
Dialogs::Ui::PaintUserpic(

View file

@ -2306,9 +2306,18 @@ void ListWidget::paintUserpics(
if (userpicTop + st::msgPhotoSize > clip.top()) {
const auto item = view->data();
const auto hasTranslation = context.gestureHorizontal.translation
&& (context.gestureHorizontal.msgBareId == item->fullId().msg.bare);
&& (context.gestureHorizontal.msgBareId
== item->fullId().msg.bare);
if (hasTranslation) {
p.translate(context.gestureHorizontal.translation, 0);
update(
QRect(
st::historyPhotoLeft
+ context.gestureHorizontal.translation,
userpicTop,
st::msgPhotoSize
- context.gestureHorizontal.translation,
st::msgPhotoSize));
}
if (const auto from = item->displayFrom()) {
from->paintUserpicLeft(