mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
CRE/ImageViewer: get scaled blitbuffer when long-press on SVG
Get a Lua userdata wrapping a crengine LVSvgImageSource object when long-press on a SVG image, and have crengine/LunaSVG render it smoothly scaled to the requested size by ImageViewer.
This commit is contained in:
@@ -1008,7 +1008,9 @@ function ReaderHighlight:onHold(arg, ges)
|
||||
-- check if we were holding on an image
|
||||
-- we provide want_frames=true, so we get a list of images for
|
||||
-- animated GIFs (supported by ImageViewer)
|
||||
local image = self.ui.document:getImageFromPosition(self.hold_pos, true)
|
||||
-- We provide accept_cre_scalable_image=true to get, if the image is a SVG image,
|
||||
-- a function that ImageViewer can use to get a perfect bb at any scale factor.
|
||||
local image = self.ui.document:getImageFromPosition(self.hold_pos, true, true)
|
||||
if image then
|
||||
logger.dbg("hold on image")
|
||||
local ImageViewer = require("ui/widget/imageviewer")
|
||||
|
||||
Reference in New Issue
Block a user