Skip to content

Conversation

prybicki
Copy link

The demo used hardcoded pixel values for several plots which didn't scale with DPI, causing them to appear too small on high-DPI displays.

Following ImGui's convention, this commit replaces hardcoded pixel values with ImGui::GetTextLineHeight() multiplied by appropriate factors. This ensures plots scale correctly with font size and DPI settings.

Affected plots:

  • PolitiFact: Who Lies More? (400px -> 25*TextLineHeight)
  • Pie charts (250x250px -> 16*TextLineHeight square)
  • Heatmaps (225x225px -> 14*TextLineHeight square)
  • Scrolling/Rolling plots (150px -> 10*TextLineHeight)
  • DragRects/DragPoints plots (150px -> 10*TextLineHeight)
  • Drag and Drop plots (195px -> 13*TextLineHeight)

This follows the same pattern used throughout ImGui's demo code for ensuring DPI-aware sizing.

The demo used hardcoded pixel values for several plots which didn't scale
with DPI, causing them to appear too small on high-DPI displays.

Following ImGui's convention, this commit replaces hardcoded pixel values
with ImGui::GetTextLineHeight() multiplied by appropriate factors. This
ensures plots scale correctly with font size and DPI settings.

Affected plots:
- PolitiFact: Who Lies More? (400px -> 25*TextLineHeight)
- Pie charts (250x250px -> 16*TextLineHeight square)
- Heatmaps (225x225px -> 14*TextLineHeight square)
- Scrolling/Rolling plots (150px -> 10*TextLineHeight)
- DragRects/DragPoints plots (150px -> 10*TextLineHeight)
- Drag and Drop plots (195px -> 13*TextLineHeight)

This follows the same pattern used throughout ImGui's demo code for
ensuring DPI-aware sizing.
@prybicki
Copy link
Author

Before:
image

After:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant