diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 350369eff..919ed9e29 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -17,6 +17,7 @@ * 修复txt最后一句不显示的bug * pro版本可以单独设置启动画面 * 优化目录界面,书签自动定位到当前章节位置 +* 修复图片有左边距的bug **2022/03/04** diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index 352f2eff8..e3c35e0b5 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -209,7 +209,6 @@ object ChapterProvider { textPages: ArrayList, imageStyle: String?, ): Float { - val absStartX = x - paddingLeft var durY = y ImageProvider.getImage(book, chapter.index, src, ReadBook.bookSource)?.let { if (durY > visibleHeight) { @@ -246,18 +245,15 @@ object ChapterProvider { textLine.lineBottom = durY val (start, end) = if (visibleWidth > width) { val adjustWidth = (visibleWidth - width) / 2f - Pair( - paddingLeft.toFloat() + adjustWidth, - paddingLeft.toFloat() + adjustWidth + width - ) + Pair(adjustWidth, adjustWidth + width) } else { - Pair(paddingLeft.toFloat(), (paddingLeft + width).toFloat()) + Pair(0f, width.toFloat()) } textLine.textChars.add( TextChar( charData = src, - start = absStartX + start, - end = absStartX + end, + start = x + start, + end = x + end, isImage = true ) )