Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] Re-factor the basic textLayer-functionality #18104

Merged
merged 1 commit into from
May 21, 2024

Commits on May 17, 2024

  1. [api-minor] Re-factor the basic textLayer-functionality

    This is very old code, and predates e.g. the introduction of JavaScript classes, which creates unnecessarily unwieldy code in the viewer.
    By introducing a new `TextLayer` class in the API, similar to how e.g. the `AnnotationLayer` looks, we're able to keep most parameters on the class-instance itself. This removes the need to manually track them in the viewer, and simplifies the call-sites.
    
    This also removes the `numTextDivs` parameter from the "textlayerrendered" event, since that's only added to support default-viewer functionality that no longer exists.
    
    Finally we try, as far as possible, to polyfill the old `renderTextLayer` and `updateTextLayer` functions since they are exposed in the library API.
    For *simple* invocations of `renderTextLayer` the behaviour should thus be the same, with only a warning printed in the console.
    Snuffleupagus committed May 17, 2024
    Configuration menu
    Copy the full SHA
    15b5808 View commit details
    Browse the repository at this point in the history