Skip to content

Commit

Permalink
Quick fix for a situation in which user drags left page over left
Browse files Browse the repository at this point in the history
edge, or right page over right edge. Will have to come up with a
proper one one day.
  • Loading branch information
harism committed May 9, 2011
1 parent 1ced672 commit 71f47d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fi/harism/curl/CurlView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 71f47d3

Please sign in to comment.