This commit is contained in:
Horis
2024-02-18 23:48:59 +08:00
parent 0312975d4a
commit cf96150775
2 changed files with 3 additions and 3 deletions
@@ -85,7 +85,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh) super.onSizeChanged(w, h, oldw, oldh)
ChapterProvider.upViewSize(w, h, isMainView) ChapterProvider.upViewSize(w, h)
textPage.format() textPage.format()
} }
@@ -850,12 +850,12 @@ object ChapterProvider {
/** /**
* 更新View尺寸 * 更新View尺寸
*/ */
fun upViewSize(width: Int, height: Int, postEvent: Boolean) { fun upViewSize(width: Int, height: Int) {
if (width > 0 && height > 0 && (width != viewWidth || height != viewHeight)) { if (width > 0 && height > 0 && (width != viewWidth || height != viewHeight)) {
viewWidth = width viewWidth = width
viewHeight = height viewHeight = height
upLayout() upLayout()
if (postEvent) postEvent(EventBus.UP_CONFIG, arrayOf(2)) postEvent(EventBus.UP_CONFIG, arrayOf(5))
} }
} }