mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
[thanos] Fixed scroll-relative coordinate mapping and Y-axis flip.
This commit is contained in:
@@ -4222,8 +4222,7 @@ void HistoryInner::captureViewForThanosEffect(
|
||||
_thanosEffect->setGeometry(QRect(QPoint(), topLevel->size()));
|
||||
_thanosEffect->raise();
|
||||
|
||||
const auto localPos = QPoint(0, screenTop + _visibleAreaTop);
|
||||
const auto globalPos = mapTo(topLevel, localPos);
|
||||
const auto globalPos = _scroll->mapTo(topLevel, QPoint(0, screenTop));
|
||||
_thanosEffect->addItem(
|
||||
std::move(image),
|
||||
QRect(globalPos, QSize(viewWidth, viewHeight)));
|
||||
|
||||
@@ -343,7 +343,8 @@ void ThanosEffectRenderer::render(
|
||||
}
|
||||
RenderUniforms uni;
|
||||
uni.rect[0] = float(item.rect.x()) / viewW;
|
||||
uni.rect[1] = float(item.rect.y()) / viewH;
|
||||
uni.rect[1] = (viewH - float(item.rect.y())
|
||||
- float(item.rect.height())) / viewH;
|
||||
uni.rect[2] = float(item.rect.width()) / viewW;
|
||||
uni.rect[3] = float(item.rect.height()) / viewH;
|
||||
uni.size[0] = float(item.rect.width());
|
||||
|
||||
Reference in New Issue
Block a user