Skip to content
Snippets Groups Projects
Commit 5ad6f1b9 authored by Anton Danilov's avatar Anton Danilov Committed by Anton Danilov
Browse files

#181 Forbidden clicking on points, which surface is not at least 50% visible

parent adf339cb
No related branches found
No related tags found
No related merge requests found
......@@ -433,6 +433,7 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> {
private void createPointDetailDialog(float x, float y, final TablexiaDialogComponentAdapter cupsComponent, String gameTitle, String gameDifficulty, String date, String score) {
float absoluteClickX = getGraphDialogsX(x);
float absoluteClickY = getGraphDialogsY(y);
if(isPointOutsideTheView(absoluteClickX)) return;
ArrayList<TablexiaDialogComponentAdapter> components = new ArrayList<TablexiaDialogComponentAdapter>();
components.add(new TouchCloseDialogComponent());
......@@ -478,6 +479,12 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> {
return textures;
}
/**Checks if surface of point is seen / hidden (50% of it) */
private boolean isPointOutsideTheView(float clickX) {
if(clickX > notebook.getX() + graphs.getX() + graphs.getWidth() || clickX < notebook.getX() + graphs.getX()) return true;
return false;
}
/**In some games is time used as score (less means better).
In order to calculate graph points, it is converted to 1/time.
This function makes the opposite to show real time.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment