New answers tagged

2

It is possible to refactor your code starting from the definition of your variables: int maxX = screenWidth - image.getWidth()/2; int minX = image.getWidth() / 2; int maxY = screenHeight - image.getHeight()/2; int minY = image.getHeight() / 2; You are repeating function calls image.getWidth(), image.getHeight() and divisions by 2 in more than one ...


Top 50 recent answers are included