优化
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
* 修复txt最后一句不显示的bug
|
* 修复txt最后一句不显示的bug
|
||||||
* pro版本可以单独设置启动画面
|
* pro版本可以单独设置启动画面
|
||||||
* 优化目录界面,书签自动定位到当前章节位置
|
* 优化目录界面,书签自动定位到当前章节位置
|
||||||
|
* 修复图片有左边距的bug
|
||||||
|
|
||||||
**2022/03/04**
|
**2022/03/04**
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ object ChapterProvider {
|
|||||||
textPages: ArrayList<TextPage>,
|
textPages: ArrayList<TextPage>,
|
||||||
imageStyle: String?,
|
imageStyle: String?,
|
||||||
): Float {
|
): Float {
|
||||||
val absStartX = x - paddingLeft
|
|
||||||
var durY = y
|
var durY = y
|
||||||
ImageProvider.getImage(book, chapter.index, src, ReadBook.bookSource)?.let {
|
ImageProvider.getImage(book, chapter.index, src, ReadBook.bookSource)?.let {
|
||||||
if (durY > visibleHeight) {
|
if (durY > visibleHeight) {
|
||||||
@@ -246,18 +245,15 @@ object ChapterProvider {
|
|||||||
textLine.lineBottom = durY
|
textLine.lineBottom = durY
|
||||||
val (start, end) = if (visibleWidth > width) {
|
val (start, end) = if (visibleWidth > width) {
|
||||||
val adjustWidth = (visibleWidth - width) / 2f
|
val adjustWidth = (visibleWidth - width) / 2f
|
||||||
Pair(
|
Pair(adjustWidth, adjustWidth + width)
|
||||||
paddingLeft.toFloat() + adjustWidth,
|
|
||||||
paddingLeft.toFloat() + adjustWidth + width
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
Pair(paddingLeft.toFloat(), (paddingLeft + width).toFloat())
|
Pair(0f, width.toFloat())
|
||||||
}
|
}
|
||||||
textLine.textChars.add(
|
textLine.textChars.add(
|
||||||
TextChar(
|
TextChar(
|
||||||
charData = src,
|
charData = src,
|
||||||
start = absStartX + start,
|
start = x + start,
|
||||||
end = absStartX + end,
|
end = x + end,
|
||||||
isImage = true
|
isImage = true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user