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)
|
# height = rect.get("height", 0)
|
||||||
width = rect['width']
|
width = rect['width']
|
||||||
height = rect['height']
|
height = rect['height']
|
||||||
|
left = rect['left']
|
||||||
|
top = rect['top']
|
||||||
if width > 1 and height > 1:
|
if width > 1 and height > 1:
|
||||||
# Fix coordinates according to zoom level
|
# Fix coordinates according to zoom level
|
||||||
# We're not checking for zoom-text-only here as that doesn't
|
# We're not checking for zoom-text-only here as that doesn't
|
||||||
# exist for QtWebEngine.
|
# exist for QtWebEngine.
|
||||||
zoom = self._tab.zoom.factor()
|
zoom = self._tab.zoom.factor()
|
||||||
rect["left"] *= zoom
|
rect = QRect(left * zoom, top * zoom,
|
||||||
rect["top"] *= zoom
|
width * zoom, height * zoom)
|
||||||
width *= zoom
|
|
||||||
height *= zoom
|
|
||||||
rect = QRect(rect["left"], rect["top"], width, height)
|
|
||||||
# FIXME:qtwebengine
|
# FIXME:qtwebengine
|
||||||
# frame = self._elem.webFrame()
|
# frame = self._elem.webFrame()
|
||||||
# while frame is not None:
|
# while frame is not None:
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<!--
|
<!-- target: hello.txt -->
|
||||||
target: hello.txt
|
|
||||||
qtwebengine_todo: Doesn't seem to work?
|
|
||||||
-->
|
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
Loading…
Reference in New Issue
Block a user