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