fixed progress bar

This commit is contained in:
2025-12-16 12:09:33 +01:00
parent ec086b2cd4
commit 81586aa768
7 changed files with 372 additions and 208 deletions

26
src/ui/MenuLayout.h Normal file
View File

@ -0,0 +1,26 @@
#pragma once
#include <array>
#include "ui/UIConstants.h"
#include <SDL3/SDL.h>
namespace ui {
struct MenuLayoutParams {
int logicalW;
int logicalH;
int winW;
int winH;
float logicalScale;
};
// Compute menu button rects in logical coordinates (content-local)
std::array<SDL_FRect, MENU_BTN_COUNT> computeMenuButtonRects(const MenuLayoutParams& p);
// Hit test a point given in logical content-local coordinates against menu buttons
// Returns index 0..4 or -1 if none
int hitTestMenuButtons(const MenuLayoutParams& p, float localX, float localY);
// Return settings button rect (logical coords)
SDL_FRect settingsButtonRect(const MenuLayoutParams& p);
} // namespace ui