mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
overlay: UI scaling option (#495)
## Link to GitHub Issue, if one exists #477 ## Description of change Add a new option for scaling the overlay. Gitadora Arena will receive 250% by default. Various overlay windows have been updated to scale properly, not perfect but they are at least usable.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
#include <windows.h>
|
||||
#include <d3d9.h>
|
||||
@@ -27,6 +28,18 @@ namespace overlay {
|
||||
extern bool USE_WM_CHAR_FOR_IMGUI_CHAR_INPUT;
|
||||
extern bool FPS_SHOULD_FLIP;
|
||||
extern bool SHOW_DEBUG_LOG_WINDOW;
|
||||
extern std::optional<uint32_t> UI_SCALE_PERCENT;
|
||||
|
||||
template <typename T>
|
||||
float apply_scaling(T input) {
|
||||
if (!UI_SCALE_PERCENT.has_value()) {
|
||||
return input;
|
||||
}
|
||||
return static_cast<float>(input) * UI_SCALE_PERCENT.value() / 100.f;
|
||||
}
|
||||
|
||||
ImVec2 apply_scaling_to_vector(const ImVec2& input);
|
||||
ImVec2 apply_scaling_to_vector(float x, float y);
|
||||
|
||||
class SpiceOverlay {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user