mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Centered text helper.
This commit is contained in:
parent
4c393a2b8d
commit
e1e0e6e140
@ -9,4 +9,16 @@ static inline ImVec2 operator+( const ImVec2& l, const ImVec2& r ) { return ImVe
|
|||||||
static inline ImVec2 operator-( const ImVec2& l, const ImVec2& r ) { return ImVec2( l.x - r.x, l.y - r.y ); }
|
static inline ImVec2 operator-( const ImVec2& l, const ImVec2& r ) { return ImVec2( l.x - r.x, l.y - r.y ); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace tracy
|
||||||
|
{
|
||||||
|
|
||||||
|
static inline void TextCentered( const char* text )
|
||||||
|
{
|
||||||
|
const auto tw = ImGui::CalcTextSize( text ).x;
|
||||||
|
ImGui::SetCursorPosX( ( ImGui::GetWindowWidth() - tw ) * 0.5f );
|
||||||
|
ImGui::Text( text );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user