mirror of
https://github.com/koreader/koreader.git
synced 2025-12-24 12:14:05 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user