DroidFish: Don't process scroll events if chess board square size is zero.

This commit is contained in:
Peter Osterlund 2011-12-04 13:01:14 +00:00
parent ec8e082d5f
commit e547c780c9

View File

@ -89,7 +89,6 @@ import android.view.View.OnClickListener;
import android.view.View.OnKeyListener; import android.view.View.OnKeyListener;
import android.view.View.OnLongClickListener; import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener; import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -325,7 +324,7 @@ public class DroidFish extends Activity implements GUIInterface {
distanceX = -distanceX; distanceX = -distanceX;
distanceY = -distanceY; distanceY = -distanceY;
} }
if (scrollSensitivity > 0) { if ((scrollSensitivity > 0) && (cb.sqSize > 0)) {
scrollX += distanceX; scrollX += distanceX;
scrollY += distanceY; scrollY += distanceY;
float scrollUnit = cb.sqSize * scrollSensitivity; float scrollUnit = cb.sqSize * scrollSensitivity;