core/popupanchor: ensure item-derived rect is at least 1x1 pixels

This commit is contained in:
outfoxxed 2025-06-18 13:41:14 -07:00
parent 9a30333405
commit 579d589290
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -189,11 +189,15 @@ void PopupAnchor::updateAnchor() {
if (this->mItem && this->mProxyWindow) { if (this->mItem && this->mProxyWindow) {
auto baseRect = auto baseRect =
this->mUserRect.isEmpty() ? this->mItem->boundingRect() : this->mUserRect.qrect(); this->mUserRect.isEmpty() ? this->mItem->boundingRect() : this->mUserRect.qrect();
auto rect = this->mProxyWindow->contentItem()->mapFromItem( auto rect = this->mProxyWindow->contentItem()->mapFromItem(
this->mItem, this->mItem,
baseRect.marginsRemoved(this->mMargins.qmargins()) baseRect.marginsRemoved(this->mMargins.qmargins())
); );
if (rect.width() < 1) rect.setWidth(1);
if (rect.height() < 1) rect.setHeight(1);
this->setWindowRect(rect.toRect()); this->setWindowRect(rect.toRect());
} }