mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 05:01:05 +01:00 
			
		
		
		
	Internals: Added drawlist and color arg to RenderArrow(), RenderBullet(). Reordered args for RenderPixelEllipsis.
This commit is contained in:
		
							
								
								
									
										17
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								imgui.cpp
									
									
									
									
									
								
							| @@ -2445,13 +2445,11 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding) | ||||
| } | ||||
|  | ||||
| // Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state | ||||
| void ImGui::RenderArrow(ImVec2 p_min, ImGuiDir dir, float scale) | ||||
| void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale) | ||||
| { | ||||
|     ImGuiContext& g = *GImGui; | ||||
|  | ||||
|     const float h = g.FontSize * 1.00f; | ||||
|     const float h = draw_list->_Data->FontSize * 1.00f; | ||||
|     float r = h * 0.40f * scale; | ||||
|     ImVec2 center = p_min + ImVec2(h * 0.50f, h * 0.50f * scale); | ||||
|     ImVec2 center = pos + ImVec2(h * 0.50f, h * 0.50f * scale); | ||||
|  | ||||
|     ImVec2 a, b, c; | ||||
|     switch (dir) | ||||
| @@ -2475,15 +2473,12 @@ void ImGui::RenderArrow(ImVec2 p_min, ImGuiDir dir, float scale) | ||||
|         IM_ASSERT(0); | ||||
|         break; | ||||
|     } | ||||
|  | ||||
|     g.CurrentWindow->DrawList->AddTriangleFilled(center + a, center + b, center + c, GetColorU32(ImGuiCol_Text)); | ||||
|     draw_list->AddTriangleFilled(center + a, center + b, center + c, col); | ||||
| } | ||||
|  | ||||
| void ImGui::RenderBullet(ImVec2 pos) | ||||
| void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col) | ||||
| { | ||||
|     ImGuiContext& g = *GImGui; | ||||
|     ImGuiWindow* window = g.CurrentWindow; | ||||
|     window->DrawList->AddCircleFilled(pos, g.FontSize*0.20f, GetColorU32(ImGuiCol_Text), 8); | ||||
|     draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8); | ||||
| } | ||||
|  | ||||
| void ImGui::RenderCheckMark(ImVec2 pos, ImU32 col, float sz) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user