1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

More compact locks drawing.

This commit is contained in:
Bartosz Taudul
2022-07-24 00:13:11 +02:00
parent efaf1df8d4
commit 0a00925a9b
2 changed files with 10 additions and 6 deletions
+4
View File
@@ -259,7 +259,9 @@ void View::DrawLockHeader( uint32_t id, const LockMap& lockmap, const SourceLoca
{
sprintf( buf, "%" PRIu32 ": %s", id, m_worker.GetString( srcloc.function ) );
}
ImGui::PushFont( m_smallFont );
DrawTextContrast( draw, wpos + ImVec2( 0, offset ), 0xFF8888FF, buf );
ImGui::PopFont();
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset ), wpos + ImVec2( w, offset + ty + 1 ) ) )
{
m_lockHoverHighlight = id;
@@ -342,7 +344,9 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
const auto delay = m_worker.GetDelay();
const auto resolution = m_worker.GetResolution();
const auto w = ImGui::GetContentRegionAvail().x - 1;
ImGui::PushFont( m_smallFont );
const auto ty = ImGui::GetTextLineHeight();
ImGui::PopFont();
const auto ostep = ty + 1;
auto draw = ImGui::GetWindowDrawList();
const auto dsz = delay * pxns;