Draw hints correctly when page is zoomed.

Fixes #199.
This commit is contained in:
Florian Bruhin 2014-10-17 11:32:41 +02:00
parent 999474c751
commit ee02f339d7

View File

@ -274,9 +274,14 @@ class HintManager(QObject):
else: else:
display = 'none' display = 'none'
rect = elem.geometry() rect = elem.geometry()
left = rect.x()
top = rect.y()
if not config.get('ui', 'zoom-text-only'):
zoom = elem.webFrame().zoomFactor()
left /= zoom
top /= zoom
return self.HINT_CSS.format( return self.HINT_CSS.format(
left=rect.x(), top=rect.y(), config=objreg.get('config'), left=left, top=top, config=objreg.get('config'), display=display)
display=display)
def _draw_label(self, elem, string): def _draw_label(self, elem, string):
"""Draw a hint label over an element. """Draw a hint label over an element.