1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 19:42:17 +02:00
This commit is contained in:
Nikolay Pultsin 2011-03-27 07:01:57 +01:00
parent eb4cc8b095
commit 5613be82ba
2 changed files with 10 additions and 10 deletions

View file

@ -187,7 +187,7 @@ public final class FBView extends ZLTextView {
final boolean horizontal = ScrollingPreferences.Instance().HorizontalOption.getValue(); final boolean horizontal = ScrollingPreferences.Instance().HorizontalOption.getValue();
final int diff = horizontal ? x - myStartX : y - myStartY; final int diff = horizontal ? x - myStartX : y - myStartY;
if (diff > 0) { if (diff > 0) {
ZLTextWordCursor cursor = getStartCursor(); final ZLTextWordCursor cursor = getStartCursor();
if (cursor == null || cursor.isNull()) { if (cursor == null || cursor.isNull()) {
return false; return false;
} }
@ -195,7 +195,7 @@ public final class FBView extends ZLTextView {
myReader.scrollViewManually(horizontal ? PAGE_LEFT : PAGE_TOP, myStartX, myStartY, x, y); myReader.scrollViewManually(horizontal ? PAGE_LEFT : PAGE_TOP, myStartX, myStartY, x, y);
} }
} else if (diff < 0) { } else if (diff < 0) {
ZLTextWordCursor cursor = getEndCursor(); final ZLTextWordCursor cursor = getEndCursor();
if (cursor == null || cursor.isNull()) { if (cursor == null || cursor.isNull()) {
return false; return false;
} }

View file

@ -138,8 +138,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
myScrollingSpeed *= 1.5; myScrollingSpeed *= 1.5;
} }
final boolean horizontal = final boolean horizontal =
(myViewPageToScroll == ZLView.PAGE_RIGHT) || myViewPageToScroll == ZLView.PAGE_RIGHT ||
(myViewPageToScroll == ZLView.PAGE_LEFT); myViewPageToScroll == ZLView.PAGE_LEFT;
final int size = horizontal ? w : h; final int size = horizontal ? w : h;
int shift = myScrollingShift < 0 ? myScrollingShift + size : myScrollingShift - size; int shift = myScrollingShift < 0 ? myScrollingShift + size : myScrollingShift - size;
switch (view.getAnimationType()) { switch (view.getAnimationType()) {
@ -267,8 +267,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
public void scrollManually(int viewPage, int startX, int startY, int endX, int endY) { public void scrollManually(int viewPage, int startX, int startY, int endX, int endY) {
final boolean horizontal = final boolean horizontal =
(viewPage == ZLView.PAGE_RIGHT) || viewPage == ZLView.PAGE_RIGHT ||
(viewPage == ZLView.PAGE_LEFT); viewPage == ZLView.PAGE_LEFT;
final int shift = horizontal ? endX - startX : endY - startY; final int shift = horizontal ? endX - startX : endY - startY;
if (myMainBitmap == null) { if (myMainBitmap == null) {
@ -602,8 +602,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
final int from = view.getScrollbarThumbLength(ZLView.PAGE_CENTRAL); final int from = view.getScrollbarThumbLength(ZLView.PAGE_CENTRAL);
final int to = view.getScrollbarThumbLength(myViewPageToScroll); final int to = view.getScrollbarThumbLength(myViewPageToScroll);
final boolean horizontal = final boolean horizontal =
(myViewPageToScroll == ZLView.PAGE_RIGHT) || myViewPageToScroll == ZLView.PAGE_RIGHT ||
(myViewPageToScroll == ZLView.PAGE_LEFT); myViewPageToScroll == ZLView.PAGE_LEFT;
final int size = horizontal ? getWidth() : getMainAreaHeight(); final int size = horizontal ? getWidth() : getMainAreaHeight();
final int shift = Math.abs(myScrollingShift); final int shift = Math.abs(myScrollingShift);
return (from * (size - shift) + to * shift) / size; return (from * (size - shift) + to * shift) / size;
@ -621,8 +621,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
final int from = view.getScrollbarThumbPosition(ZLView.PAGE_CENTRAL); final int from = view.getScrollbarThumbPosition(ZLView.PAGE_CENTRAL);
final int to = view.getScrollbarThumbPosition(myViewPageToScroll); final int to = view.getScrollbarThumbPosition(myViewPageToScroll);
final boolean horizontal = final boolean horizontal =
(myViewPageToScroll == ZLView.PAGE_RIGHT) || myViewPageToScroll == ZLView.PAGE_RIGHT ||
(myViewPageToScroll == ZLView.PAGE_LEFT); myViewPageToScroll == ZLView.PAGE_LEFT;
final int size = horizontal ? getWidth() : getMainAreaHeight(); final int size = horizontal ? getWidth() : getMainAreaHeight();
final int shift = Math.abs(myScrollingShift); final int shift = Math.abs(myScrollingShift);
return (from * (size - shift) + to * shift) / size; return (from * (size - shift) + to * shift) / size;