mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[feat] Comics: zoom to panel (#6511)
This pull requests aims to provide convenient way to zoom in comics. The idea is when user holds/double taps (not decided yet) on a manga/comic panel, it gets cut out from the rest of the image and zoomed. More details in koreader/koreader-base#1148. Depends on koreader/koreader-base#1159
This commit is contained in:
@@ -539,6 +539,23 @@ function KoptInterface:getReflowedTextBoxesFromScratch(doc, pageno)
|
||||
end
|
||||
end
|
||||
|
||||
function KoptInterface:getPanelFromPage(doc, pageno, ges)
|
||||
local page_size = Document.getNativePageDimensions(doc, pageno)
|
||||
local bbox = {
|
||||
x0 = 0, y0 = 0,
|
||||
x1 = page_size.w,
|
||||
y1 = page_size.h,
|
||||
}
|
||||
local kc = self:createContext(doc, pageno, bbox)
|
||||
kc:setZoom(1.0)
|
||||
local page = doc._document:openPage(pageno)
|
||||
page:getPagePix(kc)
|
||||
local panel = kc:getPanelFromPage(ges)
|
||||
page:close()
|
||||
kc:free()
|
||||
return panel
|
||||
end
|
||||
|
||||
--[[--
|
||||
Get text boxes in native page via optical method.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user