Document: Round dimensions properly in getPageDimensions (#8170)

* Geom:transformByScale:
  * Apply the right scaling factor to the y axis
  * Round in a more sensible fashion (àla fz_round_rect, since we pretty much exclusively use it in a similar fashion).
* Bump base (https://github.com/koreader/koreader-base/pull/1407)
This commit is contained in:
NiLuJe
2021-09-02 23:50:10 +02:00
committed by GitHub
parent 1a127633c2
commit acbf4b7a8c
5 changed files with 16 additions and 12 deletions

View File

@@ -256,7 +256,8 @@ function Document:getPageDimensions(pageno, zoom, rotation)
-- switch orientation
native_dimen.w, native_dimen.h = native_dimen.h, native_dimen.w
end
native_dimen:scaleBy(zoom)
-- Apply the zoom factor, and round to integer in a sensible manner
native_dimen:transformByScale(zoom)
return native_dimen
end
@@ -305,6 +306,7 @@ function Document:getUsedBBoxDimensions(pageno, zoom, rotation)
w = bbox.x1 - bbox.x0,
h = bbox.y1 - bbox.y0,
}
--- @note: Should we round this regardless of zoom?
if zoom ~= 1 then
ubbox_dimen:transformByScale(zoom)
end