|
|
@ -208,22 +208,23 @@ object ChapterProvider { |
|
|
|
imageStyle: String?, |
|
|
|
imageStyle: String?, |
|
|
|
): Float { |
|
|
|
): Float { |
|
|
|
var durY = y |
|
|
|
var durY = y |
|
|
|
ImageProvider.getImageSize(book, src, ReadBook.bookSource).let { |
|
|
|
val size = ImageProvider.getImageSize(book, src, ReadBook.bookSource) |
|
|
|
|
|
|
|
if (size.width > 0 && size.height > 0) { |
|
|
|
if (durY > visibleHeight) { |
|
|
|
if (durY > visibleHeight) { |
|
|
|
textPages.last().height = durY |
|
|
|
textPages.last().height = durY |
|
|
|
textPages.add(TextPage()) |
|
|
|
textPages.add(TextPage()) |
|
|
|
durY = 0f |
|
|
|
durY = 0f |
|
|
|
} |
|
|
|
} |
|
|
|
var height = it.height |
|
|
|
var height = size.height |
|
|
|
var width = it.width |
|
|
|
var width = size.width |
|
|
|
when (imageStyle?.toUpperCase(Locale.ROOT)) { |
|
|
|
when (imageStyle?.toUpperCase(Locale.ROOT)) { |
|
|
|
Book.imgStyleFull -> { |
|
|
|
Book.imgStyleFull -> { |
|
|
|
width = visibleWidth |
|
|
|
width = visibleWidth |
|
|
|
height = it.height * visibleWidth / it.width |
|
|
|
height = size.height * visibleWidth / size.width |
|
|
|
} |
|
|
|
} |
|
|
|
else -> { |
|
|
|
else -> { |
|
|
|
if (it.width > visibleWidth) { |
|
|
|
if (size.width > visibleWidth) { |
|
|
|
height = it.height * visibleWidth / it.width |
|
|
|
height = size.height * visibleWidth / size.width |
|
|
|
width = visibleWidth |
|
|
|
width = visibleWidth |
|
|
|
} |
|
|
|
} |
|
|
|
if (height > visibleHeight) { |
|
|
|
if (height > visibleHeight) { |
|
|
|