diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 11709fc161..f913b4ce0b 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -1019,7 +1019,12 @@ void ShareBox::Inner::repaintChatAtIndex(int index) { auto row = index / _columnCount; auto column = index % _columnCount; - update(style::rtlrect(_rowsLeft + qFloor(column * _rowWidthReal), row * _rowHeight, _rowWidth, _rowHeight, width())); + update(style::rtlrect( + _rowsLeft + int(std::floor(column * _rowWidthReal)), + row * _rowHeight, + _rowWidth, + _rowHeight, + width())); } ShareBox::Inner::Chat *ShareBox::Inner::getChatAtIndex(int index) { @@ -1192,7 +1197,8 @@ void ShareBox::Inner::paintChat( Painter &p, not_null chat, int index) { - auto x = _rowsLeft + qFloor((index % _columnCount) * _rowWidthReal); + auto x = _rowsLeft + + int(std::floor((index % _columnCount) * _rowWidthReal)); auto y = _rowsTop + (index / _columnCount) * _rowHeight; auto outerWidth = width(); @@ -1329,14 +1335,16 @@ void ShareBox::Inner::mouseMoveEvent(QMouseEvent *e) { 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); + auto column = int(std::floor((x - _rowsLeft) / _rowWidthReal)); if (column < 0 || column >= _columnCount) { _upon = -1; return; } - auto left = _rowsLeft + qFloor(column * _rowWidthReal) + st::shareColumnSkip / 2; + auto left = _rowsLeft + + int(std::floor(column * _rowWidthReal)) + + st::shareColumnSkip / 2; auto top = _rowsTop + row * _rowHeight + st::sharePhotoTop; auto xupon = (x >= left) && (x < left + (_rowWidth - st::shareColumnSkip)); auto yupon = (y >= top) && (y < top + _st.item.checkbox.imageRadius * 2 + st::shareNameTop + _st.item.nameStyle.font->height * 2); @@ -1361,8 +1369,8 @@ void ShareBox::Inner::selectActive() { void ShareBox::Inner::resizeEvent(QResizeEvent *e) { _columnSkip = (width() - _columnCount * _st.item.checkbox.imageRadius * 2) / float64(_columnCount + 1); _rowWidthReal = _st.item.checkbox.imageRadius * 2 + _columnSkip; - _rowsLeft = qFloor(_columnSkip / 2); - _rowWidth = qFloor(_rowWidthReal); + _rowsLeft = int(std::floor(_columnSkip / 2)); + _rowWidth = int(std::floor(_rowWidthReal)); update(); } diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index 9e1423384a..629670c9c8 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -2076,8 +2076,12 @@ not_null StickerSetBox::Inner::getLottiePlayer() { int32 StickerSetBox::Inner::stickerFromGlobalPos(const QPoint &p) const { QPoint l(mapFromGlobal(p)); if (rtl()) l.setX(width() - l.x()); - int32 row = (l.y() >= _padding.top()) ? qFloor((l.y() - _padding.top()) / _singleSize.height()) : -1; - int32 col = (l.x() >= _padding.left()) ? qFloor((l.x() - _padding.left()) / _singleSize.width()) : -1; + int32 row = (l.y() >= _padding.top()) + ? int(std::floor((l.y() - _padding.top()) / _singleSize.height())) + : -1; + int32 col = (l.x() >= _padding.left()) + ? int(std::floor((l.x() - _padding.left()) / _singleSize.width())) + : -1; if (row >= 0 && col >= 0 && col < _perRow) { int32 result = row * _perRow + col; // _elements, not _pack: premium stickers are skipped from _elements @@ -2098,7 +2102,8 @@ void StickerSetBox::Inner::paintEvent(QPaintEvent *e) { return; } - int32 from = qFloor(e->rect().top() / _singleSize.height()), to = qFloor(e->rect().bottom() / _singleSize.height()) + 1; + int32 from = int(std::floor(e->rect().top() / _singleSize.height())); + int32 to = int(std::floor(e->rect().bottom() / _singleSize.height())) + 1; _pathGradient->startFrame(0, width(), width() / 2); diff --git a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp index 0418370481..9ccb7935a4 100644 --- a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp +++ b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp @@ -434,8 +434,9 @@ FingerprintBadge SetupFingerprintBadge( } if (entry.position >= kEmojiInCarousel) { - entry.position -= qFloor(entry.position / kEmojiInCarousel) - * kEmojiInCarousel; + const auto turns + = int(std::floor(entry.position / kEmojiInCarousel)); + entry.position -= turns * kEmojiInCarousel; } while (entry.position >= 1.) { Assert(!entry.sliding.empty()); diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index 2eeb1dc24b..236e9b255f 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -4020,7 +4020,11 @@ void EmojiListWidget::updateSelected() { } else if (p.y() >= info.rowsTop && p.y() < info.rowsBottom) { auto sx = (rtl() ? width() - p.x() : p.x()) - _rowsLeft; if (sx >= 0 && sx < _columnCount * _singleSize.width()) { - const auto index = qFloor((p.y() - info.rowsTop) / _singleSize.height()) * _columnCount + qFloor(sx / _singleSize.width()); + const auto rowIndex = int(std::floor( + (p.y() - info.rowsTop) / _singleSize.height())); + const auto columnIndex + = int(std::floor(sx / _singleSize.width())); + const auto index = rowIndex * _columnCount + columnIndex; if (index < info.count) { newSelected = OverEmoji{ .section = section, .index = index }; } diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index fc02b8fb1a..5ccc8caec5 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -1173,7 +1173,9 @@ void FieldAutocomplete::Inner::paintEvent(QPaintEvent *e) { } } } else { - int32 from = qFloor(e->rect().top() / st::mentionHeight), to = qFloor(e->rect().bottom() / st::mentionHeight) + 1; + int32 from = int(std::floor(e->rect().top() / st::mentionHeight)); + int32 to = int(std::floor(e->rect().bottom() / st::mentionHeight)) + + 1; int32 last = !_mrows->empty() ? _mrows->size() : !_hrows->empty() diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 5146f2f4e0..1f71f78e66 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -3687,8 +3687,10 @@ void StickersListWidget::updateSelected() { newSelected = OverGroupAdd{}; } } else { - const auto rowIndex = qFloor(yOffset / _singleSize.height()); - const auto columnIndex = qFloor(sx / _singleSize.width()); + const auto rowIndex + = int(std::floor(yOffset / _singleSize.height())); + const auto columnIndex + = int(std::floor(sx / _singleSize.width())); const auto index = rowIndex * _columnCount + columnIndex; if (index >= 0 && index < set.stickers.size()) { auto overDelete = false; diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 7a47917466..aafcab505e 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -2917,8 +2917,8 @@ void OverlayWidget::zoomOut(std::optional anchor) { auto newZoom = _zoom; const auto full = _fullScreenVideo ? _zoomToScreen : _zoomToDefault; if (newZoom == kZoomToScreenLevel) { - if (qFloor(full) >= -kMaxZoomLevel) { - newZoom = qFloor(full); + if (int(std::floor(full)) >= -kMaxZoomLevel) { + newZoom = int(std::floor(full)); } } else { if (newZoom > full && (newZoom - 1 < full || (full < -kMaxZoomLevel && newZoom == -kMaxZoomLevel))) { @@ -2937,7 +2937,7 @@ void OverlayWidget::zoomReset() { auto newZoom = _zoom; const auto full = _fullScreenVideo ? _zoomToScreen : _zoomToDefault; if (_zoom == 0) { - if (qFloor(full) == int(std::ceil(full)) + if (int(std::floor(full)) == int(std::ceil(full)) && qRound(full) >= -kMaxZoomLevel && qRound(full) <= kMaxZoomLevel) { newZoom = qRound(full); diff --git a/Telegram/SourceFiles/window/section_widget.cpp b/Telegram/SourceFiles/window/section_widget.cpp index 5d51bb32d5..1c11463f21 100644 --- a/Telegram/SourceFiles/window/section_widget.cpp +++ b/Telegram/SourceFiles/window/section_widget.cpp @@ -498,8 +498,8 @@ void SectionWidget::PaintBackground( const auto bottom = clip.top() + clip.height(); const auto w = tiled.width() / float64(style::DevicePixelRatio()); const auto h = tiled.height() / float64(style::DevicePixelRatio()); - const auto sx = qFloor(left / w); - const auto sy = qFloor(top / h); + const auto sx = int(std::floor(left / w)); + const auto sy = int(std::floor(top / h)); const auto cx = int(std::ceil(right / w)); const auto cy = int(std::ceil(bottom / h)); for (auto i = sx; i < cx; ++i) { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 672d04b164..a7fec59f14 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 672d04b164f91e44cd48ea7f7f492358e653a79e +Subproject commit a7fec59f14f14d31bdf582bcdd4db96be738d083