HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
theme_length.hpp
1
2
3
4#pragma once
5
6hi_export namespace hi { inline namespace v1 {
7
9public:
10
16 pixels pixels(float ppi, float font_size = 12.0f) const noexcept
17 {
18 if (auto *pixel_ptr = std::get_if<pixels>(&_v)) {
19 return *pixel_ptr;
20
21 } else if (auto dips_ptr = std::get_if<dips>(&_v)) {
22
23 } else if (auto em_quads_ptr = std::get_if<em_quads>(&_v)) {
24
25 } else {
26 hi_no_default();
27 }
28 }
29
30
31private:
32 std::variant<pixels, dips, em_quads> _v;
33};
34
35
36}}
37
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Definition theme_length.hpp:8
pixels pixels(float ppi, float font_size=12.0f) const noexcept
Definition theme_length.hpp:16