feat: 优化代码

pull/105/head
kunfei 5 years ago
parent 5b8174d644
commit ab2d3cbe39
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt

@ -489,10 +489,10 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi
* 计算拖拽点对应的拖拽脚 * 计算拖拽点对应的拖拽脚
*/ */
private fun calcCornerXY(x: Float, y: Float) { private fun calcCornerXY(x: Float, y: Float) {
mCornerX = if (x <= viewWidth * 0.5) 0 else viewWidth mCornerX = if (x <= viewWidth / 2.0) 0 else viewWidth
mCornerY = if (y <= viewHeight * 0.5) 0 else viewHeight mCornerY = if (y <= viewHeight / 2.0) 0 else viewHeight
mIsRtOrLb = (mCornerX == 0 && mCornerY == viewHeight) mIsRtOrLb = (mCornerX == 0 && mCornerY == viewHeight)
|| (mCornerX == viewWidth && mCornerY == 0) || (mCornerY == 0 && mCornerX == viewWidth)
} }
private fun calcPoints() { private fun calcPoints() {

Loading…
Cancel
Save