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

framebuffer: Make sure scaleBySize honors a DPI override #1258

Merged
merged 3 commits into from Dec 12, 2020

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Dec 12, 2020

Even if said override happens to match the native DPI, because the scaleBySize heuristic is weird and results would differ.

c.f., koreader/koreader#6977 (comment)


This change is Reviewable

Useful when switching from a custom DPI to the native one.
(As that's what front does)
@Frenzie Frenzie merged commit ab6cf44 into koreader:master Dec 12, 2020
@poire-z
Copy link
Contributor

poire-z commented Dec 12, 2020

Ref koreader/koreader#6977 (comment)

So, we continue getting a different result whether auto 300 dpi vs. user-set 300 dpi ?
You're less puzzled than yesterday ? Or just don't want to introduce a change ?

NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Dec 12, 2020
@NiLuJe
Copy link
Member Author

NiLuJe commented Dec 12, 2020

Getting consistent results would involve just always going the scale_size + scale_dpi way (with scale_dpi actually being the scaleByDpi computation, i.e., dpi / 160), which would change a lot of things, yeah.

At least this way it does what it probably intended to do without the weird corner-case of "except when override matches native".

@NiLuJe
Copy link
Member Author

NiLuJe commented Dec 12, 2020

And this way, we can actually see what would happen if we went that route, by setting an override that matches our device's native DPI ;).

@NiLuJe
Copy link
Member Author

NiLuJe commented Dec 12, 2020

At least on paper, it's definitely not a bad idea, and would probably not change much on legacy 600x800 devices, because scale_size is 1 there, and scaleByDpi would be almost exactly 1, too (167 / 160).

@poire-z
Copy link
Contributor

poire-z commented Dec 12, 2020

OK, so not less puzzled :)

NiLuJe added a commit to koreader/koreader that referenced this pull request Dec 13, 2020
…avior (#6984)

* Make switching *back* to the default DPI via auto actually work
properly.

eg., by actually setting DPI back to defaults, and clearing the override
flag.

* Bump base to pickup koreader/koreader-base#1258
roygbyte pushed a commit to roygbyte/koreader-base that referenced this pull request Mar 3, 2022
* Make sure scaleBySize *always* honors a DPI override, even if it's set to
the native DPI...

As discussed in koreader/koreader#6977

* Allow clearing a DPI override

Useful when switching from a custom DPI to the native one.

* Plug clearDPI into setDPI if it gets a nil

(As that's what front does)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants