From 37d50dccf92543fd6f042fa7127ef6f6ff05137f Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 21 Mar 2016 22:30:32 +0100 Subject: [PATCH] Added GetFontTexUvWhitePixel() helper. --- imgui.cpp | 5 +++++ imgui.h | 1 + 2 files changed, 6 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 7593bd47d..5bfa19d57 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4838,6 +4838,11 @@ float ImGui::GetFontSize() return GImGui->FontSize; } +ImVec2 ImGui::GetFontTexUvWhitePixel() +{ + return GImGui->FontTexUvWhitePixel; +} + void ImGui::SetWindowFontScale(float scale) { ImGuiState& g = *GImGui; diff --git a/imgui.h b/imgui.h index df23e7bdd..55f18692a 100644 --- a/imgui.h +++ b/imgui.h @@ -171,6 +171,7 @@ namespace ImGui IMGUI_API void PopStyleVar(int count = 1); IMGUI_API ImFont* GetFont(); // get current font IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied + IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied