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:
parent
a637de4bc5
commit
57d896e989
@ -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:
|
||||
|
@ -1,9 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<!--
|
||||
target: hello.txt
|
||||
qtwebengine_todo: Doesn't seem to work?
|
||||
-->
|
||||
<!-- target: hello.txt -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
Loading…
Reference in New Issue
Block a user