Fonts: added a 'void* UserData' field in ImFontAtlas, as a convenience for use by applications using multiple font atlases.

+ fixed mislocated Changelog entries added recently.
This commit is contained in:
ocornut 2022-12-01 20:08:43 +01:00
parent 9825f7fa87
commit 0e2a167bdb
2 changed files with 7 additions and 4 deletions

View File

@ -48,6 +48,10 @@ Other changes:
We expect this behavior to be further improved/tweaked. (#3795, #4559) [@ocornut, @folays] We expect this behavior to be further improved/tweaked. (#3795, #4559) [@ocornut, @folays]
- Text: fixed layouting of wrapped-text block when the last source line is above the - Text: fixed layouting of wrapped-text block when the last source line is above the
clipping region. Regression added in 1.89. (#5720, #5919) clipping region. Regression added in 1.89. (#5720, #5919)
- Fonts: added a 'void* UserData' field in ImFontAtlas, as a convenience for use by
applications using multiple font atlases.
- Demo: simplified "Inputs" section, moved contents to Metrics->Inputs.
- Debug Tools: Metrics: added "Inputs" section, moved from Demo for consistency.
- Misc: fixed parameters to IMGUI_DEBUG_LOG() not being dead-stripped when building - Misc: fixed parameters to IMGUI_DEBUG_LOG() not being dead-stripped when building
with IMGUI_DISABLE_DEBUG_TOOLS is used. (#5901) [@Teselka] with IMGUI_DISABLE_DEBUG_TOOLS is used. (#5901) [@Teselka]
- Misc: fixed compile-time detection of SSE features on MSVC 32-bits builds. (#5943) [@TheMostDiligent] - Misc: fixed compile-time detection of SSE features on MSVC 32-bits builds. (#5943) [@TheMostDiligent]
@ -79,8 +83,6 @@ Other changes:
- Drag and Drop: fixed GetDragDropPayload() returning a non-NULL value if a drag source is - Drag and Drop: fixed GetDragDropPayload() returning a non-NULL value if a drag source is
active but a payload hasn't been submitted yet. This is convenient to detect new payload active but a payload hasn't been submitted yet. This is convenient to detect new payload
from within a drag source handler. (#5910, #143) from within a drag source handler. (#5910, #143)
- Demo: simplified "Inputs" section, moved contents to Metrics->Inputs.
- Debug Tools: Metrics: added "Inputs" section, moved from Demo for consistency.
- Backends: GLFW: cancel out errors emitted by glfwGetKeyName() when a name is missing. (#5908) - Backends: GLFW: cancel out errors emitted by glfwGetKeyName() when a name is missing. (#5908)
- Backends: WebGPU: fixed validation error with default depth buffer settings. (#5869, #5914) [@kdchambers] - Backends: WebGPU: fixed validation error with default depth buffer settings. (#5869, #5914) [@kdchambers]

View File

@ -23,7 +23,7 @@
// Library Version // Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345')
#define IMGUI_VERSION "1.89.2 WIP" #define IMGUI_VERSION "1.89.2 WIP"
#define IMGUI_VERSION_NUM 18913 #define IMGUI_VERSION_NUM 18914
#define IMGUI_HAS_TABLE #define IMGUI_HAS_TABLE
/* /*
@ -1911,7 +1911,7 @@ struct ImGuiIO
float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds. float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
float HoverDelayNormal; // = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true. float HoverDelayNormal; // = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true.
float HoverDelayShort; // = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true. float HoverDelayShort; // = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true.
void* UserData; // = NULL // Store your own data for retrieval by callbacks. void* UserData; // = NULL // Store your own data.
ImFontAtlas*Fonts; // <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture. ImFontAtlas*Fonts; // <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
float FontGlobalScale; // = 1.0f // Global scale all fonts float FontGlobalScale; // = 1.0f // Global scale all fonts
@ -2808,6 +2808,7 @@ struct ImFontAtlas
int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height. int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false). int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).
bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert. bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
void* UserData; // Store your own atlas related user-data (if e.g. you have multiple font atlas).
// [Internal] // [Internal]
// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you. // NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.