From 71f47d36b9ea4b3f304122bbe14c3229bbcfe15e Mon Sep 17 00:00:00 2001 From: harism Date: Mon, 9 May 2011 21:27:50 +0300 Subject: [PATCH] Quick fix for a situation in which user drags left page over left edge, or right page over right edge. Will have to come up with a proper one one day. --- src/fi/harism/curl/CurlView.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fi/harism/curl/CurlView.java b/src/fi/harism/curl/CurlView.java index c786bdc..65162e1 100644 --- a/src/fi/harism/curl/CurlView.java +++ b/src/fi/harism/curl/CurlView.java @@ -434,6 +434,11 @@ private void setCurlPos(PointF curlPos, PointF curlDir, double radius) { if (mCurlState == CURL_RIGHT || (mCurlState == CURL_LEFT && mViewMode == SHOW_ONE_PAGE)) { RectF pageRect = mRenderer.getPageRect(CurlRenderer.PAGE_RIGHT); + if (curlPos.x >= pageRect.right) { + mPageCurl.reset(); + requestRender(); + return; + } if (curlPos.x < pageRect.left) { curlPos.x = pageRect.left; } @@ -450,6 +455,11 @@ private void setCurlPos(PointF curlPos, PointF curlDir, double radius) { } } else if (mCurlState == CURL_LEFT) { RectF pageRect = mRenderer.getPageRect(CurlRenderer.PAGE_LEFT); + if (curlPos.x <= pageRect.left) { + mPageCurl.reset(); + requestRender(); + return; + } if (curlPos.x > pageRect.right) { curlPos.x = pageRect.right; }