mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fixed column bounds check in ShareBox for mouse to prevent cross-rows.
Fixed #30155.
This commit is contained in:
@@ -1313,6 +1313,12 @@ void ShareBox::Inner::updateUpon(const QPoint &pos) {
|
||||
auto x = pos.x(), y = pos.y();
|
||||
auto row = (y - _rowsTop) / _rowHeight;
|
||||
auto column = qFloor((x - _rowsLeft) / _rowWidthReal);
|
||||
|
||||
if (column < 0 || column >= _columnCount) {
|
||||
_upon = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
auto left = _rowsLeft + qFloor(column * _rowWidthReal) + st::shareColumnSkip / 2;
|
||||
auto top = _rowsTop + row * _rowHeight + st::sharePhotoTop;
|
||||
auto xupon = (x >= left) && (x < left + (_rowWidth - st::shareColumnSkip));
|
||||
|
||||
Reference in New Issue
Block a user