mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +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
|
struct TimelineContext
|
||||||
{
|
{
|
||||||
float w, ty, scale;
|
float w, ty, sty, scale;
|
||||||
float yMin, yMax;
|
float yMin, yMax;
|
||||||
double pxns, nspx;
|
double pxns, nspx;
|
||||||
int64_t vStart, vEnd;
|
int64_t vStart, vEnd;
|
||||||
|
@ -97,7 +97,7 @@ std::optional<int> TimelineController::CalculateScrollPosition() const
|
|||||||
return std::nullopt;
|
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 = [&] () {
|
auto shouldUpdateCenterItem = [&] () {
|
||||||
const auto imguiChangedScroll = m_scroll != ImGui::GetScrollY();
|
const auto imguiChangedScroll = m_scroll != ImGui::GetScrollY();
|
||||||
@ -123,6 +123,9 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
|
|||||||
TimelineContext ctx;
|
TimelineContext ctx;
|
||||||
ctx.w = ImGui::GetContentRegionAvail().x - 1;
|
ctx.w = ImGui::GetContentRegionAvail().x - 1;
|
||||||
ctx.ty = ImGui::GetTextLineHeight();
|
ctx.ty = ImGui::GetTextLineHeight();
|
||||||
|
ImGui::PushFont( smallFont );
|
||||||
|
ctx.sty = ImGui::GetTextLineHeight();
|
||||||
|
ImGui::PopFont();
|
||||||
ctx.scale = GetScale();
|
ctx.scale = GetScale();
|
||||||
ctx.yMin = yMin;
|
ctx.yMin = yMin;
|
||||||
ctx.yMax = yMax;
|
ctx.yMax = yMax;
|
||||||
|
@ -25,7 +25,7 @@ public:
|
|||||||
|
|
||||||
void FirstFrameExpired();
|
void FirstFrameExpired();
|
||||||
void Begin();
|
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>
|
template<class T, class U>
|
||||||
void AddItem( U* data )
|
void AddItem( U* data )
|
||||||
|
@ -385,7 +385,7 @@ void View::DrawTimeline()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto vcenter = verticallyCenterTimeline && drawMouseLine && m_viewMode == ViewMode::Paused;
|
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();
|
ImGui::EndChild();
|
||||||
|
|
||||||
m_lockHighlight = m_nextLockHighlight;
|
m_lockHighlight = m_nextLockHighlight;
|
||||||
|
Loading…
Reference in New Issue
Block a user