Skip to content

Commit 1a70dbe

Browse files
committed
OverlayWidget: Fix layouting for bottom and right alignment
See QRect.{bottom,right}
1 parent 7fe9ad1 commit 1a70dbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Orange/widgets/utils/overlay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ def getsize(hint, minimum, maximum, policy):
158158
if alignment & Qt.AlignLeft:
159159
x = bounds.x()
160160
elif alignment & Qt.AlignRight:
161-
x = bounds.right() - size.width()
161+
x = bounds.x() + bounds.width() - size.width()
162162
else:
163163
x = bounds.x() + max(0, bounds.width() - size.width()) // 2
164164

165165
if alignment & Qt.AlignTop:
166166
y = bounds.y()
167167
elif alignment & Qt.AlignBottom:
168-
y = bounds.bottom() - size.height()
168+
y = bounds.y() + bounds.height() - size.height()
169169
else:
170170
y = bounds.y() + max(0, bounds.height() - size.height()) // 2
171171

0 commit comments

Comments
 (0)