From 8be9adbd62df7080c5571ff409d6b8cc78191162 Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 18 Nov 2016 00:16:58 +0100 Subject: [PATCH] simplify main menu logo piece positioning --- src/itdelatrisu/opsu/states/MainMenu.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/itdelatrisu/opsu/states/MainMenu.java b/src/itdelatrisu/opsu/states/MainMenu.java index 5e52d372..f6c7a203 100644 --- a/src/itdelatrisu/opsu/states/MainMenu.java +++ b/src/itdelatrisu/opsu/states/MainMenu.java @@ -276,14 +276,11 @@ public class MainMenu extends BasicGameState { if (position != null) { double scale = 1 - (0 - position) * 0.05; logo.draw(Color.white, (float) scale); - Image piece = GameImage.MENU_LOGO_PIECE.getImage(); - float xRadius = piece.getWidth() / 2; - float yRadius = piece.getHeight() / 2; - piece = piece.getScaledCopy(logo.getCurrentScale()); - float scaleposmodx = piece.getWidth() / 2 - xRadius; - float scaleposmody = piece.getHeight() / 2 - yRadius; + Image piece = GameImage.MENU_LOGO_PIECE.getImage().getScaledCopy(logo.getCurrentScale()); + float scaleposmodx = piece.getWidth() / 2; + float scaleposmody = piece.getHeight() / 2; piece.rotate((float)(position * 360)); - piece.draw(logo.getX() - xRadius - scaleposmodx, logo.getY() - yRadius - scaleposmody); + piece.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody); } else { logo.draw(); }