]> git.gir.st - VimFx.git/commit
Improve markable element area comparisons
authorSimon Lydell <simon.lydell@gmail.com>
Sun, 6 Nov 2016 10:27:45 +0000 (11:27 +0100)
committerSimon Lydell <simon.lydell@gmail.com>
Sun, 6 Nov 2016 15:20:45 +0000 (16:20 +0100)
commit11e2db52b75985647741c706f8e096af166d4554
treeabb66f62cea21a8ac582e28094ffaccba8b213b5
parent1840f5b15218c7ffdf592f2020bd6731be199e12
Improve markable element area comparisons

Boxes that appear to be exactly the same size should be given "equally"
good hints, favoring earlier ones when needed. Sometimes, though, their
areas differ from a fraction of a pixel up to a couple of pixels.

This commits changes how the comparisons of marker weights (which
effectively are element areas), so that elements whose area differ by
less than 10px are considered to have the same area. That results in the
expected hints for same-sized boxes.

Refs. #831: The browser tabs often had this problem. At first, all tabs
could be given the expected hints: The first one getting the best one
etc. Opening a new tab, the best hint could suddenly be given to some
random tab in the middle.
extension/lib/marker-container.coffee
extension/lib/viewport.coffee
package.json
Imprint / Impressum