[webkit-help] Howto Calculate x, y points for GraphicsContext::drawFocusRing()

Ariya Hidayat ariya.hidayat at gmail.com
Thu Feb 11 07:19:58 PST 2010


> Actually, I want to increase active area of links, in such a way that event
> if I clicked below the link,
> (i.e. not exactly over the link) the nearer link should get selected and
> gets loaded. Right now, I have to click exactly over the link.

I guess this is the reason you asked the endless hit test questions in
the separate thread? If only you would have told us your objective
before...

There are tons of ways to do that. Two I can think of:

(1) Find all links in the page and calculate the distance to your
click position. Pick the nearest one (or whatever algorithm you use).

(2) "Probe" in the vicinity of your click position for any presence of
others links. An example I show in
http://labs.trolltech.com/blogs/2009/06/06/qwebview-snap-scrolling/
does the same, albeit for any type of elements instead of only links.



Regards,

-- 
Ariya Hidayat
http://www.linkedin.com/in/ariyahidayat


More information about the webkit-help mailing list