diff --git a/profiler/src/profiler/TracyImGui.cpp b/profiler/src/profiler/TracyImGui.cpp index 8ce798f9..42c87c98 100644 --- a/profiler/src/profiler/TracyImGui.cpp +++ b/profiler/src/profiler/TracyImGui.cpp @@ -169,8 +169,8 @@ bool PrintTextWrapped( const char* text, const char* end, bool strikethrough, bo ImGui::SameLine( 0, 0 ); auto x1 = ImGui::GetCursorScreenPos().x + scale; ImGui::NewLine(); - if( strikethrough ) ImGui::GetWindowDrawList()->AddLine( ImVec2( x0, y1 ), ImVec2( x1, y1 ), color, scale ); - if( underline ) ImGui::GetWindowDrawList()->AddLine( ImVec2( x0, y2 ), ImVec2( x1, y2 ), color, scale ); + if( strikethrough ) ImGui::GetWindowDrawList()->AddLineH( x0, x1, y1, color, scale ); + if( underline ) ImGui::GetWindowDrawList()->AddLineH( x0, x1, y2, color, scale ); } else { @@ -194,8 +194,8 @@ bool PrintTextWrapped( const char* text, const char* end, bool strikethrough, bo ImGui::SameLine( 0, 0 ); auto x1 = ImGui::GetCursorScreenPos().x + scale; ImGui::NewLine(); - if( strikethrough ) ImGui::GetWindowDrawList()->AddLine( ImVec2( x0, y1 ), ImVec2( x1, y1 ), color, scale ); - if( underline ) ImGui::GetWindowDrawList()->AddLine( ImVec2( x0, y2 ), ImVec2( x1, y2 ), color, scale ); + if( strikethrough ) ImGui::GetWindowDrawList()->AddLineH( x0, x1, y1, color, scale ); + if( underline ) ImGui::GetWindowDrawList()->AddLineH( x0, x1, y2, color, scale ); } else { @@ -222,7 +222,7 @@ bool DragHeightSplitter( const char* id, float& height, float minHeight, float m const auto p0 = ImGui::GetItemRectMin(); const auto p1 = ImGui::GetItemRectMax(); const float y = ( p0.y + p1.y ) * 0.5f; - draw->AddLine( ImVec2( p0.x, y ), ImVec2( p1.x, y ), color, thickness ); + draw->AddLineH( p0.x, p1.x, y, color, thickness ); return active; } diff --git a/profiler/src/profiler/TracyMarkdown.cpp b/profiler/src/profiler/TracyMarkdown.cpp index 42b2d227..d268801f 100644 --- a/profiler/src/profiler/TracyMarkdown.cpp +++ b/profiler/src/profiler/TracyMarkdown.cpp @@ -261,9 +261,8 @@ public: { const auto scale = GetScale(); const auto pos = ImGui::GetCursorScreenPos(); - const auto offset = ImVec2( 8.f * scale, 0 ); ImGui::Unindent(); - ImGui::GetWindowDrawList()->AddLine( origin - offset, pos - offset, color, 2.f * scale ); + ImGui::GetWindowDrawList()->AddLineV( origin.x - 8.f * scale, origin.y, pos.y, color, 2.f * scale ); break; } default: diff --git a/profiler/src/profiler/TracyView_Options.cpp b/profiler/src/profiler/TracyView_Options.cpp index 663b84f9..bd3d2776 100644 --- a/profiler/src/profiler/TracyView_Options.cpp +++ b/profiler/src/profiler/TracyView_Options.cpp @@ -827,7 +827,7 @@ void View::DrawOptions() if( ImGui::BeginDragDropTargetCustom( ImRect( wposx, m_threadDnd[i] - half, wposx + w, m_threadDnd[i] + half ), i+1 ) ) { auto draw = ImGui::GetWindowDrawList(); - draw->AddLine( ImVec2( wposx, m_threadDnd[i] ), ImVec2( wposx + w, m_threadDnd[i] ), ImGui::GetColorU32(ImGuiCol_DragDropTarget), 2.f ); + draw->AddLineH( wposx, wposx + w, m_threadDnd[i], ImGui::GetColorU32(ImGuiCol_DragDropTarget), 2.f ); if( auto payload = ImGui::AcceptDragDropPayload( "ThreadOrder", ImGuiDragDropFlags_AcceptNoDrawDefaultRect ) ) { target = (int)i; diff --git a/profiler/src/profiler/TracyView_ZoneTimeline.cpp b/profiler/src/profiler/TracyView_ZoneTimeline.cpp index 1e815288..d42a8a78 100644 --- a/profiler/src/profiler/TracyView_ZoneTimeline.cpp +++ b/profiler/src/profiler/TracyView_ZoneTimeline.cpp @@ -648,7 +648,7 @@ void View::DrawThreadCropper( const int depth, const uint64_t tid, const float x draw->AddCircle( center, hradius, 0xFFFFFFFF, 0, hoverCircleThickness ); const float wPosX = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMin().x; const float wSizeX = ImGui::GetWindowContentRegionMax().x; - draw->AddLine( ImVec2( wPosX, yPos + ( lane + 1 ) * ostep ), ImVec2( wPosX + wSizeX, yPos + ( lane + 1 ) * ostep ), 0x880000FF, 2.0f * GetScale() ); + draw->AddLineH( wPosX, wPosX + wSizeX, yPos + ( lane + 1 ) * ostep, 0x880000FF, 2.0f * GetScale() ); if( clicked ) { const int newDepthLimit = lane + 1;