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

[PDF] footer cuts off bottom of page in page mode #5612

Closed
yparitcher opened this issue Nov 19, 2019 · 5 comments · Fixed by #5620
Closed

[PDF] footer cuts off bottom of page in page mode #5612

yparitcher opened this issue Nov 19, 2019 · 5 comments · Fixed by #5620
Labels

Comments

@yparitcher
Copy link
Member

  • KOReader version: v2019.11-20-g15fe0fef_2019-11-18
  • Device: emulator

Issue

regression symptom of #3870

- return self.footer_text:getSize().h
+ return self.footer_content:getSize().h

by changing the effective footer height from 24 to 15

when setting the offset to half the non visible area (ie: the space subtracted because of the footer)

self.state.offset = Geom:new{x = 0, y = 0}
if self.dimen.h > self.visible_area.h then
self.state.offset.y = (self.dimen.h - self.visible_area.h) / 2
end

causes the footer to actually cover the pdf by half its height ~ 7, however when the footer height was supposedly 24 of which half is 12 the extra 3 pixels were not noticed.

the underlying cause is not taking the footer into account when calculating the offset.
however if the offset is lessened when the footer is present the footer does not properly update on toggle.

screenshots from the paper.pdf in the test submodule, page 19
the calculation is cut off
Reader_2019-Nov-18_224532

when changing

    if self.dimen.h > self.visible_area.h then
-        self.state.offset.y = (self.dimen.h - self.visible_area.h) / 2
+        self.state.offset.y = ((self.dimen.h - self.visible_area.h)- self.ui.view.footer:getHeight()) / 2
    end

the calculation is visible
Reader_2019-Nov-18_225002

and when tapping on the footer to hide it, only the sides of the footer are hidden
Reader_2019-Nov-18_225010

@NiLuJe
Copy link
Member

NiLuJe commented Nov 19, 2019

IIRC, there's a (very, very) long-standing issue with the footer clobbering the bottom of PDF pages. There might even be an open issue about it (if there is, it's an old one).

@yparitcher
Copy link
Member Author

IIRC, there's a (very, very) long-standing issue with the footer clobbering the bottom of PDF pages. There might even be an open issue about it (if there is, it's an old one).

that would be #2072 fixed by #2079
however that only hid the symptoms.

this only happens when the page is bound by height for example if the zoom mode is contentheight.

i would like to fix it, however i am having a vey hard time understanding the code.

yparitcher added a commit to yparitcher/koreader that referenced this issue Nov 19, 2019
@yparitcher
Copy link
Member Author

i have a partial fix in yparitcher@ad126f4

however when doing so the onTapFooter does not properly hide the footer like so:

if the footer was toggled on on the current page, it will also toggle off, even when panning in the middle

if the footer was toggled on on a different page, it will not toggle off (visibly) until the page is turned. (panning does not help)

@Frenzie Frenzie added the bug label Nov 19, 2019
@yparitcher
Copy link
Member Author

yparitcher commented Nov 20, 2019 via email

@Frenzie
Copy link
Member

Frenzie commented Nov 20, 2019

view … reset to the top of the page, even when panned

/twitchtwitch

That would annoy me immensely, and probably not just me. ;-)

this to me is bit of a hack

Depends on how you use the footer, I suppose. I'd say not painting under the overlay sounds like premature optimization with a lot of extra effort involved to make it work.

Frenzie pushed a commit that referenced this issue Nov 21, 2019
closes #5612 

the change in `ReaderView:recalculate()` causes the viewable page size to be calculated by not including the footer, causing the text not to get cut off.

since the page area was not drawing under the footer `ReaderView:drawPageSurround()` had to be fixed to draw the margin under the footer so when tapping the footer off the area should be dran the background color.
mwoz123 pushed a commit to mwoz123/koreader that referenced this issue Mar 29, 2020
closes koreader#5612 

the change in `ReaderView:recalculate()` causes the viewable page size to be calculated by not including the footer, causing the text not to get cut off.

since the page area was not drawing under the footer `ReaderView:drawPageSurround()` had to be fixed to draw the margin under the footer so when tapping the footer off the area should be dran the background color.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants