Skip to content

Commit

Permalink
Update docs / 2024-01-08 / 18:51:34
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 8, 2024
1 parent 9fbe58d commit be82d62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 7 additions & 5 deletions docs/book/_sources/doc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ __HelloImGui::GetRunnerParams()__ will return the runnerParams of the current a
# Place widgets in a DPI-aware way


Special care must be taken in order to correctly handle screen with high DPI (for example, almost all recent laptops screens).
Special care must be taken in order to correctly handle screen with high DPI
(for example, almost all recent laptops screens).

Using ImVec2 with fixed values is *almost always a bad idea* if you intend your application to be used on high DPI screens!
Otherwise, widgets might be misplaced or too small on different screens and/or OSes.
Using ImVec2 with fixed values is *almost always a bad idea* if you intend your
application to be used on high DPI screens!
Otherwise, widgets might be misplaced or too small on different screens and/or OSes.

Instead you should use scale your widgets and windows relatively to the font size, as is done
with the [em CSS Unit](https://lyty.dev/css/css-unit.html).
Instead you should use scale your widgets and windows relatively to the font size,
as is done with the [em CSS Unit](https://lyty.dev/css/css-unit.html).


```cpp
Expand Down
10 changes: 6 additions & 4 deletions docs/book/doc_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,13 @@ <h1>Run Application<a class="headerlink" href="#run-application" title="Permalin
<hr class="docutils" />
<section class="tex2jax_ignore mathjax_ignore" id="place-widgets-in-a-dpi-aware-way">
<h1>Place widgets in a DPI-aware way<a class="headerlink" href="#place-widgets-in-a-dpi-aware-way" title="Permalink to this heading">#</a></h1>
<p>Special care must be taken in order to correctly handle screen with high DPI (for example, almost all recent laptops screens).</p>
<p>Using ImVec2 with fixed values is <em>almost always a bad idea</em> if you intend your application to be used on high DPI screens!
<p>Special care must be taken in order to correctly handle screen with high DPI
(for example, almost all recent laptops screens).</p>
<p>Using ImVec2 with fixed values is <em>almost always a bad idea</em> if you intend your
application to be used on high DPI screens!
Otherwise, widgets might be misplaced or too small on different screens and/or OSes.</p>
<p>Instead you should use scale your widgets and windows relatively to the font size, as is done
with the <a class="reference external" href="https://lyty.dev/css/css-unit.html">em CSS Unit</a>.</p>
<p>Instead you should use scale your widgets and windows relatively to the font size,
as is done with the <a class="reference external" href="https://lyty.dev/css/css-unit.html">em CSS Unit</a>.</p>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="c1">// __HelloImGui::EmToVec2()__ returns an ImVec2 that you can use to size</span>
<span class="c1">// or place your widgets in a DPI independent way.</span>
<span class="c1">// Values are in multiples of the font size (i.e. as in the em CSS unit).</span>
Expand Down

0 comments on commit be82d62

Please sign in to comment.