[Webkit-unassigned] [Bug 72731] New: QWebHitTestResult and SVG rendering with QWebFrame
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Nov 18 08:19:21 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=72731
Summary: QWebHitTestResult and SVG rendering with QWebFrame
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
URL: http://pvbrowser.org
OS/Version: Linux
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: WebKit Qt
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: lehrig at t-online.de
I want to know which graphical object within a SVG is clicked.
It is done like that:
QWebFrame *wf = ... which i use ...;
QWebHitTestResult result = wf->hitTestContent(QPoint(x,y)); // x,y from mouse event
QWebElement e = result.element();
QRect r = result.boundingRect();
printf("WebKit hitTestResult: xy=%d,%d wh=%d,%d isNull=%d\n", r.x(), r.y(), r.width(), r.height(), e.isNull());
It works on rectangles, circles ...
But not on text. There the QWebElement isNull.
Probably this is because the XML for the text has no width and height attribute as other objects have.
<g
id="MyIdentifier"
inkscape:label="#g5029">
<rect
y="42.362183"
x="467"
height="33"
width="87"
id="rect5009"
style="fill:#999999;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;" />
<text
sodipodi:linespacing="125%"
id="text5016"
y="63.362183"
x="486"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans;"
xml:space="preserve"><tspan
y="63.362183"
x="486"
id="tspan5018"
sodipodi:role="line">MyText</tspan></text>
</g>
If the mouse is clicked above the <rect i can identify "MyIdentifier"
But if the mouse is clicked above <text a NULL element is returned although the result.boundingRect() is correctly returned.
Since there is no width and height attribute on the text the style fontsize etc... should be used.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list