Skip to content

Commit

Permalink
Merge pull request AirGuanZ#9 from MennoVink/main
Browse files Browse the repository at this point in the history
imgui 1.84.2 fixes
  • Loading branch information
dfranx authored Sep 18, 2021
2 parents 75e2406 + 6f7d1be commit e17ea0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ImFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace ifd {
clicked = false;
}
if (hovered || active)
window->DrawList->AddRectFilled(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : ImGuiCol_HeaderHovered]));
window->DrawList->AddRectFilled(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : ImGuiCol_HeaderHovered]));

// Icon, text
float icon_posX = pos.x + g.FontSize + g.Style.FramePadding.y;
Expand All @@ -82,7 +82,7 @@ namespace ifd {
bool hovered = ImGui::IsItemHovered();
bool active = ImGui::IsItemActive();
if (hovered || active)
window->DrawList->AddRectFilled(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : ImGuiCol_HeaderHovered]));
window->DrawList->AddRectFilled(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : ImGuiCol_HeaderHovered]));

// Icon, text
window->DrawList->AddImage(icon, ImVec2(pos.x, pos.y), ImVec2(pos.x + ICON_SIZE, pos.y + ICON_SIZE));
Expand Down Expand Up @@ -230,7 +230,7 @@ namespace ifd {
bool hovered = ImGui::IsItemHovered();
bool active = ImGui::IsItemActive();

float size = window->DC.LastItemRect.Max.x - window->DC.LastItemRect.Min.x;
float size = g.LastItemData.Rect.Max.x - g.LastItemData.Rect.Min.x;

int numPoints = 5;
float innerRadius = size / 4;
Expand Down Expand Up @@ -300,7 +300,7 @@ namespace ifd {


if (hovered || active || isSelected)
window->DrawList->AddRectFilled(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : (isSelected ? ImGuiCol_Header : ImGuiCol_HeaderHovered)]));
window->DrawList->AddRectFilled(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : (isSelected ? ImGuiCol_Header : ImGuiCol_HeaderHovered)]));

if (hasPreview) {
ImVec2 availSize = ImVec2(size.x, iconSize);
Expand Down

0 comments on commit e17ea0d

Please sign in to comment.