• Robert Knight's avatar
    Ignore zero-height highlights when creating bucket bar buckets · e1eaca4a
    Robert Knight authored
    When a PDF page transitions from a rendered to non-rendered state the
    text layer element is removed and existing highlights in that layer
    briefly become disconnected from the document. As a result they have an
    empty/zero client rect as returned by `element.getBoundingClientRect()`.
    This caused the bucket-building logic to think that the anchor
    had moved to the top of the screen as the `top` and `bottom` coordinates
    of the anchor box became zero. This could lead to anchors which should
    be in the "below screen" bucket briefly jumping to the "above screen"
    bucket. Once re-anchoring completes and the highlight is anchored into a
    placeholder element for the non-rendered page, its anchor box becomes
    non-empty again and the anchor "jumps back" to the "below screen" box.
    
    This commit adds logic to ignore any highlights which have zero height,
    including highlight elements that are disconnected from the document.
    e1eaca4a
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...