Skip to content

Commit 579d589

Browse files
committed
core/popupanchor: ensure item-derived rect is at least 1x1 pixels
1 parent 9a30333 commit 579d589

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/popupanchor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,15 @@ void PopupAnchor::updateAnchor() {
189189
if (this->mItem && this->mProxyWindow) {
190190
auto baseRect =
191191
this->mUserRect.isEmpty() ? this->mItem->boundingRect() : this->mUserRect.qrect();
192+
192193
auto rect = this->mProxyWindow->contentItem()->mapFromItem(
193194
this->mItem,
194195
baseRect.marginsRemoved(this->mMargins.qmargins())
195196
);
196197

198+
if (rect.width() < 1) rect.setWidth(1);
199+
if (rect.height() < 1) rect.setHeight(1);
200+
197201
this->setWindowRect(rect.toRect());
198202
}
199203

0 commit comments

Comments
 (0)