-
Notifications
You must be signed in to change notification settings - Fork 96
fix: correctly decorators for vertical scrolling pages #671
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
fix: correctly decorators for vertical scrolling pages #671
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes decorator styling for vertical scrolling pages by exposing the writing mode via data attributes and refactoring CSS inline generation.
- In HtmlDecorationTemplate.kt, the CSS string concatenation is replaced with a buildString block and the styles for different writing modes are added.
- In decorator.js, attribute assignments and element positioning logic are updated to account for vertical writing modes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
readium/navigator/src/main/java/org/readium/r2/navigator/html/HtmlDecorationTemplate.kt | Refactored CSS generation using buildString and added style rules for vertical writing modes. |
readium/navigator/src/main/assets/_scripts/src/decorator.js | Updated attribute assignment to use dataset properties and adjusted positioning logic for vertical scrolling. |
readium/navigator/src/main/java/org/readium/r2/navigator/html/HtmlDecorationTemplate.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @shovel-kun, this is working great!
Hello, |
@qnga Good catch, I've included changes for vertical LR. You can find the Mongolian EPUB example used in the screenshots below here: readium/swift-toolkit#516 EDIT: I've also fixed incorrect bounds layout on vertical RTL, the notes annotation is now correctly aligned above in test app. |
Great work, thanks a lot! |
Co-authored-by: Mickaël Menu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the changes 🙏
This PR fixes decorators on vertical scrolling pages.
I've decided to expose the
writing-mode
of a decorator's text range by using a data attribute for styling customizability.adding_decorators.webm
editing_decorators.webm