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

Annotation / highlight scale based on root HTML element, not "scaler" div #161

Open
danielweck opened this issue Mar 5, 2015 · 1 comment

Comments

@danielweck
Copy link
Member

https://github.com/readium/readium-shared-js/blob/develop/lib/annotations_module.js#L576

        var $html = $(this.get("contentDocumentDOM"));
        var matrix = $('html', $html).css('-webkit-transform');
        var scale = new WebKitCSSMatrix(matrix).a;
        this.set("scale", scale);

https://github.com/readium/readium-shared-js/blob/develop/js/views/one_page_view.js#L565

        if (reader.needsFixedLayoutScalerWorkAround())
        {
            var css1 = ReadiumSDK.Helpers.CSSTransformString({scale : scale, enable3D: enable3D});
            _$epubHtml.css(css1);

            var css2 = ReadiumSDK.Helpers.CSSTransformString({scale : 1, enable3D: enable3D});
            css2["width"] = _meta_size.width;
            css2["height"] = _meta_size.height;
            _$scaler.css(css2);
        }
        else
        {
            var css = ReadiumSDK.Helpers.CSSTransformString({scale : scale, enable3D: enable3D});
            css["width"] = _meta_size.width;
            css["height"] = _meta_size.height;
            _$scaler.css(css);
        }

Related issue: #154

@danielweck
Copy link
Member Author

Related to
readium/readium-js-viewer#313 (comment)
(needsFixedLayoutScalerWorkAround)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants