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

Provide small font height in TimelineContext.

This commit is contained in:
Bartosz Taudul
2023-03-25 17:25:10 +01:00
parent c0136dbdcc
commit dcf27f4989
4 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -97,7 +97,7 @@ std::optional<int> TimelineController::CalculateScrollPosition() const
return std::nullopt;
}
void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax )
void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax, ImFont* smallFont )
{
auto shouldUpdateCenterItem = [&] () {
const auto imguiChangedScroll = m_scroll != ImGui::GetScrollY();
@@ -123,6 +123,9 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
TimelineContext ctx;
ctx.w = ImGui::GetContentRegionAvail().x - 1;
ctx.ty = ImGui::GetTextLineHeight();
ImGui::PushFont( smallFont );
ctx.sty = ImGui::GetTextLineHeight();
ImGui::PopFont();
ctx.scale = GetScale();
ctx.yMin = yMin;
ctx.yMax = yMax;