GCC Code Coverage Report


./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
0 of 11, 0 excluded
0.0%
Functions:
0 of 3, 0 excluded
0.0%
Branches:
0 of 0, 0 excluded
-%

libs/imgui/src/eu/imgui/init.cc
Line Branch Exec Source
1 #include "eu/imgui/init.h"
2
3 #include <SDL_video.h>
4 #include "imgui.h"
5
6 namespace eu::imgui
7 {
8
9 ✗ float calculate_app_scale()
10 {
11 ✗ return SDL_GetDisplayContentScale(SDL_GetPrimaryDisplay());
12 }
13
14 ✗ std::pair<int, int> rescale_window(int width, int height, float app_scale)
15 {
16 ✗ const auto new_width = static_cast<int>(static_cast<float>(width) * app_scale);
17 ✗ const auto new_height = static_cast<int>(static_cast<float>(height) * app_scale);
18 ✗ return { new_width, new_height };
19 }
20
21 ✗ void setup_scale(float app_scale)
22 {
23 // scale dear imgui: https://wiki.libsdl.org/SDL3/README-highdpi
24 ✗ auto& style = ImGui::GetStyle();
25 ✗ style.ScaleAllSizes(app_scale);
26 ✗ style.FontScaleDpi *= app_scale;
27 ✗ }
28
29
30 }
31