mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-10-26 12:27:30 +00:00 
			
		
		
		
	Plot: overlay label clipped within frame when bigger than frame
This commit is contained in:
		| @@ -5951,7 +5951,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett | |||||||
|  |  | ||||||
|     // Text overlay |     // Text overlay | ||||||
|     if (overlay_text) |     if (overlay_text) | ||||||
|         RenderText(ImVec2(inner_bb.GetCenter().x - ImGui::CalcTextSize(overlay_text, NULL, true).x*0.5f, frame_bb.Min.y + style.FramePadding.y), overlay_text); |         RenderTextClipped(ImVec2(ImMax(inner_bb.Min.x, inner_bb.GetCenter().x - ImGui::CalcTextSize(overlay_text, NULL, true).x*0.5f), frame_bb.Min.y + style.FramePadding.y), overlay_text, NULL, NULL, frame_bb.Max); | ||||||
|  |  | ||||||
|     RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label); |     RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ocornut
					ocornut