mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Merge c977c68095c0b797f200426e9c5a5ca1755d7fff into 900dd3bd0fb8a04546dc7a62aa034f80c40527d3
This commit is contained in:
commit
58894943d0
@ -297,6 +297,8 @@ void InitImGui()
|
||||
io.RenderDrawListsFn = ImImpl_RenderDrawLists;
|
||||
io.SetClipboardTextFn = ImImpl_SetClipboardTextFn;
|
||||
io.GetClipboardTextFn = ImImpl_GetClipboardTextFn;
|
||||
|
||||
ImGui::GetStyle().PixelCenterOffset = 0.5f; // to make texels & pixels align
|
||||
}
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR, int)
|
||||
|
||||
@ -214,6 +214,7 @@ ImGuiStyle::ImGuiStyle()
|
||||
TreeNodeSpacing = 22.0f;
|
||||
ColumnsMinSpacing = 6.0f; // Minimum space between two columns
|
||||
ScrollBarWidth = 16.0f;
|
||||
PixelCenterOffset = 0.0f; // for <= d3d9, this should be 0.5f. for ogl & d3d10+, 0.0f is correct
|
||||
|
||||
Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
|
||||
Colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
|
||||
@ -3358,8 +3359,8 @@ bool RadioButton(const char* label, bool active)
|
||||
return false;
|
||||
|
||||
ImVec2 center = check_bb.GetCenter();
|
||||
center.x = (float)(int)center.x + 0.5f;
|
||||
center.y = (float)(int)center.y + 0.5f;
|
||||
center.x = (float)(int)center.x + style.PixelCenterOffset;
|
||||
center.y = (float)(int)center.y + style.PixelCenterOffset;
|
||||
const float radius = check_bb.GetHeight() * 0.5f;
|
||||
|
||||
const bool hovered = (g.HoveredWindow == window) && (g.HoveredId == 0) && IsMouseHoveringBox(check_bb);
|
||||
@ -4996,8 +4997,8 @@ void ImBitmapFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& c
|
||||
const float outline = (float)Info->Outline;
|
||||
|
||||
// Align to be pixel perfect
|
||||
pos.x = (float)(int)pos.x + 0.5f;
|
||||
pos.y = (float)(int)pos.y + 0.5f;
|
||||
pos.x = (float)(int)pos.x + ImGui::GetStyle().PixelCenterOffset;
|
||||
pos.y = (float)(int)pos.y + ImGui::GetStyle().PixelCenterOffset;
|
||||
|
||||
ImVec2 text_size = ImVec2(0,0);
|
||||
float line_width = 0.0f;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user