epub 显示图片,未完善

pull/274/head
gedoor 5 years ago
parent 674c7a0da0
commit 8cc16e10b6
  1. 15
      app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt

@ -123,11 +123,18 @@ object ChapterProvider {
var durY = y var durY = y
ImageProvider.getImage(book, src)?.let { ImageProvider.getImage(book, src)?.let {
var height = it.height var height = it.height
val width = if (it.width > visibleWidth) { var width = it.width
if (it.width > visibleWidth) {
height = it.height * visibleWidth / it.width height = it.height * visibleWidth / it.width
visibleWidth width = visibleWidth
} else { }
it.width if (height > visibleHeight) {
width = width * visibleHeight / height
height = visibleHeight
}
if (durY + height > visibleHeight) {
textPages.add(TextPage())
durY = 0f
} }
val textLine = TextLine(isImage = true) val textLine = TextLine(isImage = true)
textLine.lineTop = durY textLine.lineTop = durY

Loading…
Cancel
Save