From 11aa7d521684f8187e012eb7163611df7eb94076 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 11 Jan 2024 17:23:01 +0100 Subject: [PATCH] fixed button placement on Android once more --- control.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/control.cpp b/control.cpp index 5b08c5f4..cd15dcd2 100644 --- a/control.cpp +++ b/control.cpp @@ -1304,9 +1304,10 @@ EX void displayabutton(int px, int py, string s, int col) { int rad = (int) realradius(); if(vid.stereo_mode == sLR) rad = 99999; int vrx = min(rad, vid.xres/2 - 40); - int vry = min(rad, min(current_display->ycenter, vid.yres - current_display->ycenter) - 20); + int maxy = min(current_display->ycenter, vid.yres - current_display->ycenter); + int vry = min(rad, maxy - 20); vrx = max(vrx, vid.xres/3); - vry = max(vry, vid.yres/3); + vry = max(vry, maxy * 2/3); int x = current_display->xcenter + px * vrx; int y = current_display->ycenter + py * (vry - siz/2); int vrr = int(hypot(vrx, vry) * sqrt(2.));