mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Provide small font height in TimelineContext.
This commit is contained in:
parent
c0136dbdcc
commit
dcf27f4989
@ -10,7 +10,7 @@ namespace tracy
|
||||
|
||||
struct TimelineContext
|
||||
{
|
||||
float w, ty, scale;
|
||||
float w, ty, sty, scale;
|
||||
float yMin, yMax;
|
||||
double pxns, nspx;
|
||||
int64_t vStart, vEnd;
|
||||
|
@ -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;
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
|
||||
void FirstFrameExpired();
|
||||
void Begin();
|
||||
void End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax );
|
||||
void End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax, ImFont* smallFont );
|
||||
|
||||
template<class T, class U>
|
||||
void AddItem( U* data )
|
||||
|
@ -385,7 +385,7 @@ void View::DrawTimeline()
|
||||
}
|
||||
|
||||
const auto vcenter = verticallyCenterTimeline && drawMouseLine && m_viewMode == ViewMode::Paused;
|
||||
m_tc.End( pxns, wpos, hover, vcenter, yMin, yMax );
|
||||
m_tc.End( pxns, wpos, hover, vcenter, yMin, yMax, m_smallFont );
|
||||
ImGui::EndChild();
|
||||
|
||||
m_lockHighlight = m_nextLockHighlight;
|
||||
|
Loading…
Reference in New Issue
Block a user