Commit 698a4b89 authored by Luboš Horáček's avatar Luboš Horáček

#332 Padání při otvírání novin

parent ae1b8558
......@@ -340,7 +340,12 @@ public class NewspaperFragment extends Fragment implements OnTouchListener, OnCl
double ratioY = (double) backgroundBitmap.getHeight() / displaySize.y;
if (((event.getX() * ratioX) < backgroundBitmap.getWidth()) && ((event.getY() * ratioY) < backgroundBitmap.getHeight())) {
Log.d("TOUCH", event.getX() + ", " + event.getY());
int pixel = backgroundBitmap.getPixel((int) (event.getX() * ratioX), (int) (event.getY() * ratioY));
int touchX = (int) (event.getX() * ratioX);
int touchY = (int) (event.getY() * ratioY);
if ((touchX < 0) || (touchX >= backgroundBitmap.getWidth()) || (touchY < 0) || (touchY >= backgroundBitmap.getHeight())) {
return false;
}
int pixel = backgroundBitmap.getPixel(touchX, touchY);
if (Color.alpha(pixel) != 255) {
handler.removeCallbacks(runnable);
arrowNewspaper.clearAnimation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment