mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-02-06 20:29:10 +01:00
DroidFish: Align the chess board to the top of its drawing area in landscape mode. Makes it aligned with the new non-full-width title bar.
This commit is contained in:
parent
db057ea137
commit
b4736fe3dc
|
@ -28,6 +28,7 @@ import org.petero.droidfish.gamelogic.Position;
|
|||
import org.petero.droidfish.gamelogic.TextIO;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -71,7 +72,9 @@ public class ChessBoardPlay extends ChessBoard {
|
|||
@Override
|
||||
protected void computeOrigin(int width, int height) {
|
||||
x0 = (width - sqSize * 8) / 2;
|
||||
y0 = (height - sqSize * 8) / 2;
|
||||
Configuration config = getResources().getConfiguration();
|
||||
boolean landScape = (config.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
y0 = landScape ? 0 : (height - sqSize * 8) / 2;
|
||||
}
|
||||
@Override
|
||||
protected int getXFromSq(int sq) { return Position.getX(sq); }
|
||||
|
|
Loading…
Reference in New Issue
Block a user