mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Internals: RenderArrow: apply scale to horizontal offset. (#3895)
In the absence of a better standardized symbol/icon design this seem more consistent.
This commit is contained in:
parent
4326411672
commit
726399ff76
@ -7563,7 +7563,7 @@ void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir d
|
|||||||
{
|
{
|
||||||
const float h = draw_list->_Data->FontSize * 1.00f;
|
const float h = draw_list->_Data->FontSize * 1.00f;
|
||||||
float r = h * 0.40f * scale;
|
float r = h * 0.40f * scale;
|
||||||
ImVec2 center = pos + ImVec2(h * 0.50f, h * 0.50f * scale);
|
ImVec2 center = pos + ImVec2(h * 0.50f * scale, h * 0.50f * scale);
|
||||||
|
|
||||||
ImVec2 a, b, c;
|
ImVec2 a, b, c;
|
||||||
switch (dir)
|
switch (dir)
|
||||||
|
|||||||
@ -3435,7 +3435,7 @@ void ImGui::TableHeader(const char* label)
|
|||||||
PopStyleColor();
|
PopStyleColor();
|
||||||
x += w_sort_text;
|
x += w_sort_text;
|
||||||
}
|
}
|
||||||
RenderArrow(window->DrawList, ImVec2(x, y), GetColorU32(ImGuiCol_Text), column->SortDirection == ImGuiSortDirection_Ascending ? ImGuiDir_Up : ImGuiDir_Down, ARROW_SCALE);
|
RenderArrow(window->DrawList, ImVec2(x + (g.FontSize * (1.0f - ARROW_SCALE) * 0.5f) , y), GetColorU32(ImGuiCol_Text), column->SortDirection == ImGuiSortDirection_Ascending ? ImGuiDir_Up : ImGuiDir_Down, ARROW_SCALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle clicking on column header to adjust Sort Order
|
// Handle clicking on column header to adjust Sort Order
|
||||||
|
|||||||
@ -7281,7 +7281,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
|||||||
if (flags & ImGuiTreeNodeFlags_Bullet)
|
if (flags & ImGuiTreeNodeFlags_Bullet)
|
||||||
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
|
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
|
||||||
else if (!is_leaf)
|
else if (!is_leaf)
|
||||||
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f);
|
RenderArrow(window->DrawList, ImVec2(text_pos.x + g.FontSize * 0.15f - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f);
|
||||||
if (g.LogEnabled)
|
if (g.LogEnabled)
|
||||||
LogSetNextTextDecoration(">", NULL);
|
LogSetNextTextDecoration(">", NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user