Adapt to DPI scaling.

This commit is contained in:
Bartosz Taudul 2020-04-04 14:19:23 +02:00
parent 78a0773f38
commit 268af5b67c

View File

@ -18,7 +18,7 @@ namespace tracy
{ {
enum { JumpSeparation = 6 }; enum { JumpSeparation = 6 };
enum { JumpArrow = 9 }; enum { JumpArrowBase = 9 };
SourceView::SourceView( ImFont* font ) SourceView::SourceView( ImFont* font )
: m_font( font ) : m_font( font )
@ -406,7 +406,7 @@ void SourceView::Render( const Worker& worker )
} }
else else
{ {
const auto th = ImGui::GetTextLineHeightWithSpacing(); const auto th = (int)ImGui::GetTextLineHeightWithSpacing();
ImGuiListClipper clipper( (int)m_asm.size(), th ); ImGuiListClipper clipper( (int)m_asm.size(), th );
while( clipper.Step() ) while( clipper.Step() )
{ {
@ -443,6 +443,7 @@ void SourceView::Render( const Worker& worker )
const auto minAddr = m_asm[clipper.DisplayStart].addr; const auto minAddr = m_asm[clipper.DisplayStart].addr;
const auto maxAddr = m_asm[clipper.DisplayEnd-1].addr; const auto maxAddr = m_asm[clipper.DisplayEnd-1].addr;
const auto mjl = m_maxJumpLevel; const auto mjl = m_maxJumpLevel;
const auto JumpArrow = JumpArrowBase * ts.y / 15;
int i = -1; int i = -1;
for( auto& v : m_jumpTable ) for( auto& v : m_jumpTable )