This repository was archived by the owner on May 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Fix/viewport clipped #188
Open
johanpoirier
wants to merge
23
commits into
readium:develop
Choose a base branch
from
TEA-ebook:fix/viewport-clipped
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix/viewport clipped #188
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
bcb93ed
Update README.md
johanpoirier 1ad833a
Merge branch 'develop' of github.com:TEA-ebook/readium-shared-js into…
johanpoirier 5bbd42b
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier 5db0768
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier 7211ddc
css prefixes should be handled by jQuery (need to double-check transf…
danielweck 7df4a21
ah, transitions must be treated separately, CSS prefix for value as w…
danielweck 2de2a08
minor comment
danielweck 8b22b4d
Merge pull request #137 from readium/feature/cssPrefixes
danielweck e64be62
overflow should only be enabled for fixed-layout pan-zoom, not reflow…
danielweck cab6a21
Remove incorrect spine item check based on a page index.
jccr 09cccf3
Added BSD-style license file license.txt to the root of the repo.
rkwright 1f5dea0
Update README.md
johanpoirier c3fac9f
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier 3158be7
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier 1212f7a
Merge branch 'master' into release/0.17
rkwright 195709b
Fixes dual mouse / touch support in Windows8 (WebKit/Chromium -based …
danielweck e4af415
Merge branch 'release/0.17' into develop
rkwright 6503cd2
Merge branch 'develop' of https://github.com/readium/readium-shared-j…
rkwright 6404ef4
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier 6554b88
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier a60583e
Merge remote-tracking branch 'readium/develop' into develop
johanpoirier bf04a87
Do not round column width value: it causes wrong value of page offset
johanpoirier 3be5f04
Fix: round column width value for css
johanpoirier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -452,9 +452,8 @@ ReadiumSDK.Views.ReflowableView = function(options, reader){ | |
| } | ||
|
|
||
| function onPaginationChanged(initiator, paginationRequest_spineItem, paginationRequest_elementId) { | ||
| _paginationInfo.pageOffset = Math.round((_paginationInfo.columnWidth + _paginationInfo.columnGap) * _paginationInfo.visibleColumnCount * _paginationInfo.currentSpreadIndex); | ||
|
|
||
| _paginationInfo.pageOffset = (_paginationInfo.columnWidth + _paginationInfo.columnGap) * _paginationInfo.visibleColumnCount * _paginationInfo.currentSpreadIndex; | ||
|
|
||
| redraw(); | ||
| self.trigger(ReadiumSDK.InternalEvents.CURRENT_VIEW_PAGINATION_CHANGED, { paginationInfo: self.getPaginationInfo(), initiator: initiator, spineItem: paginationRequest_spineItem, elementId: paginationRequest_elementId } ); | ||
| } | ||
|
|
@@ -620,15 +619,15 @@ ReadiumSDK.Views.ReflowableView = function(options, reader){ | |
|
|
||
| _paginationInfo.rightToLeft = _spine.isRightToLeft(); | ||
|
|
||
| _paginationInfo.columnWidth = Math.round(((_htmlBodyIsVerticalWritingMode ? _lastViewPortSize.height : _lastViewPortSize.width) - _paginationInfo.columnGap * (_paginationInfo.visibleColumnCount - 1)) / _paginationInfo.visibleColumnCount); | ||
| _paginationInfo.columnWidth = ((_htmlBodyIsVerticalWritingMode ? _lastViewPortSize.height : _lastViewPortSize.width) - _paginationInfo.columnGap * (_paginationInfo.visibleColumnCount - 1)) / _paginationInfo.visibleColumnCount; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the same reasons as above function getColumnFullWidth() {
if (!options.paginationInfo || isVerticalWritingMode())
{
return $iframe.width();
}
return options.paginationInfo.columnWidth + options.paginationInfo.columnGap;
} |
||
|
|
||
| var useColumnCountNotWidth = _paginationInfo.visibleColumnCount > 1; // column-count == 1 does not work in Chrome, and is not needed anyway (HTML width is full viewport width, no Firefox video flickering) | ||
| if (useColumnCountNotWidth) { | ||
| _$epubHtml.css("width", _lastViewPortSize.width + "px"); | ||
| _$epubHtml.css("column-count", _paginationInfo.visibleColumnCount); | ||
| } else { | ||
| _$epubHtml.css("width", (_htmlBodyIsVerticalWritingMode ? _lastViewPortSize.width : _paginationInfo.columnWidth) + "px"); | ||
| _$epubHtml.css("column-width", _paginationInfo.columnWidth + "px"); | ||
| _$epubHtml.css("width", (_htmlBodyIsVerticalWritingMode ? _lastViewPortSize.width : Math.round(_paginationInfo.columnWidth)) + "px"); | ||
| _$epubHtml.css("column-width", Math.round(_paginationInfo.columnWidth) + "px"); | ||
| } | ||
|
|
||
| _$epubHtml.css("column-fill", "auto"); | ||
|
|
@@ -642,14 +641,13 @@ ReadiumSDK.Views.ReflowableView = function(options, reader){ | |
|
|
||
| var totalGaps = (_paginationInfo.columnCount-1) * _paginationInfo.columnGap; | ||
| var colWidthCheck = ((_htmlBodyIsVerticalWritingMode ? _$epubHtml[0].scrollHeight : _$epubHtml[0].scrollWidth) - totalGaps) / _paginationInfo.columnCount; | ||
| colWidthCheck = Math.round(colWidthCheck); | ||
|
|
||
| if (colWidthCheck > _paginationInfo.columnWidth) | ||
| { | ||
| console.debug("ADJUST COLUMN"); | ||
| console.log(_paginationInfo.columnWidth); | ||
| console.log(colWidthCheck); | ||
|
|
||
| _paginationInfo.columnWidth = colWidthCheck; | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Although I like the idea of deferring the numerical rounding until the last minute (i.e. application of CSS rules), I am concerned that / curious about the fact that
_paginationInfo.pageOffsetpotentially contains many decimal places, and is used in the "CFI navigation logic" calculations:https://github.com/readium/readium-shared-js/blob/develop/js/views/cfi_navigation_logic.js#L116