Fix hints when zoomed with QtWebEngine

We mutated rect (coming from self._js_dict), which means we used the
already adjusted values the second time we called rect_on_view.

Fixes #1863.
This commit is contained in:
Florian Bruhin 2016-09-21 20:09:31 +02:00
parent a637de4bc5
commit 57d896e989
2 changed files with 5 additions and 9 deletions

View File

@ -140,16 +140,15 @@ class WebEngineElement(webelem.AbstractWebElement):
# height = rect.get("height", 0)
width = rect['width']
height = rect['height']
left = rect['left']
top = rect['top']
if width > 1 and height > 1:
# Fix coordinates according to zoom level
# We're not checking for zoom-text-only here as that doesn't
# exist for QtWebEngine.
zoom = self._tab.zoom.factor()
rect["left"] *= zoom
rect["top"] *= zoom
width *= zoom
height *= zoom
rect = QRect(rect["left"], rect["top"], width, height)
rect = QRect(left * zoom, top * zoom,
width * zoom, height * zoom)
# FIXME:qtwebengine
# frame = self._elem.webFrame()
# while frame is not None:

View File

@ -1,9 +1,6 @@
<!DOCTYPE html>
<!--
target: hello.txt
qtwebengine_todo: Doesn't seem to work?
-->
<!-- target: hello.txt -->
<html>
<head>