hints: translate client rectangles into parent frames

This commit is contained in:
Jakub Klinkovský 2016-02-24 22:56:06 +01:00
parent d630f966e7
commit b1207650b0

View File

@ -450,7 +450,14 @@ class HintManager(QObject):
rect["top"] *= zoom
width *= zoom
height *= zoom
return QRect(rect["left"], rect["top"], width, height)
rect = QRect(rect["left"], rect["top"], width, height)
frame = elem.webFrame()
while frame is not None:
# Translate to parent frames' position
# (scroll position is taken care of inside getClientRects)
rect.translate(frame.geometry().topLeft())
frame = frame.parentFrame()
return rect
return elem.rect_on_view()
def _click(self, elem, context):