pull/48/head
kunfei 5 years ago
parent 5793f63a0b
commit 6edfd8f7a3
  1. 18
      app/src/main/java/io/legado/app/ui/widget/page/curl/CurlRenderer.kt

@ -82,7 +82,7 @@ class CurlRenderer(private val mObserver: Observer) : GLSurfaceView.Renderer {
mViewRect.bottom = -1.0f mViewRect.bottom = -1.0f
mViewRect.left = -ratio mViewRect.left = -ratio
mViewRect.right = ratio mViewRect.right = ratio
updatePageRects() updatePageRect()
gl.glMatrixMode(GL10.GL_PROJECTION) gl.glMatrixMode(GL10.GL_PROJECTION)
gl.glLoadIdentity() gl.glLoadIdentity()
@ -121,13 +121,13 @@ class CurlRenderer(private val mObserver: Observer) : GLSurfaceView.Renderer {
* SHOW_TWO_PAGES. * SHOW_TWO_PAGES.
*/ */
@Synchronized @Synchronized
fun setViewMode(viewmode: Int) { fun setViewMode(viewMode: Int) {
if (viewmode == SHOW_ONE_PAGE) { if (viewMode == SHOW_ONE_PAGE) {
mViewMode = viewmode mViewMode = viewMode
updatePageRects() updatePageRect()
} else if (viewmode == SHOW_TWO_PAGES) { } else if (viewMode == SHOW_TWO_PAGES) {
mViewMode = viewmode mViewMode = viewMode
updatePageRects() updatePageRect()
} }
} }
@ -142,7 +142,7 @@ class CurlRenderer(private val mObserver: Observer) : GLSurfaceView.Renderer {
/** /**
* Recalculates page rectangles. * Recalculates page rectangles.
*/ */
private fun updatePageRects() { private fun updatePageRect() {
if (mViewRect.width() == 0f || mViewRect.height() == 0f) { if (mViewRect.width() == 0f || mViewRect.height() == 0f) {
return return
} else if (mViewMode == SHOW_ONE_PAGE) { } else if (mViewMode == SHOW_ONE_PAGE) {

Loading…
Cancel
Save