]> git.gir.st - VimFx.git/commit
Improve marker generation. Fix #325.
authorSimon Lydell <simon.lydell@gmail.com>
Fri, 30 May 2014 09:29:36 +0000 (11:29 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Fri, 30 May 2014 21:12:26 +0000 (23:12 +0200)
commita3cb61bf81e1ee8b382d7d910abd0bceb6dff3eb
tree0121a5caeedf7e8fec28df38711d1efed43b8548
parent42065759a1d771f7c9206a0ceb88491303c40d19
Improve marker generation. Fix #325.

- Elements covered by other elements do no longer get hints. This makes
  it easier to use drop-down menus when there are lots of links behind
  it.

- Elements partly outside the screen now get hints, too.

- Partly covered elements get hints, too. The hint is placed in the
  first non-covered point of the element.

- Line-wrapped links now get their hint in a better place. This is
  easiest to explain with a picture. # = old hint location, * = new hint
  location (approximately)

  #---------+
  |   *Line-|
  |wrapped  |
  +---------+

  Such links also used to count the whole of that box as its area. Now
  only the actual text is counted, giving the marker a more fair weight.

- We used to take care of the case where markable elements have no area
  since all of the children are floated and/or absolutely positioned.
  For performance I’ve removed that. Let’s re-add it if we find some
  website that needs it. The old implementation used the computed style
  for this, which has turned out to be really slow.

- We used to check if elements were hidden with CSS (if `opacity: 0;` or
  `visibility: hidden;`), but we don’t anymore, since it noticeably
  slows down the marker creation (checking computed styles is slow). It
  does not appear to be necessary anymore. It was added to fix #164, but
  the problems there now seem fixed even without this check.

- The code should be more documented now than before.

- The performance is better than before. It does not seem like the new
  algorithms are slower. And since I’ve removed two slow areas, it might
  be a little faster.
extension/packages/mode-hints/hints.coffee
extension/packages/mode-hints/marker.coffee
extension/packages/mode-hints/mode-hints.coffee
extension/packages/utils.coffee
extension/resources/style.css
Imprint / Impressum