Push pxns to HeaderExtraContents().

This commit is contained in:
Bartosz Taudul 2022-09-03 22:55:54 +02:00
parent 3ee928a7d1
commit 840709fe46
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
4 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ void TimelineItem::Draw( bool firstFrame, double pxns, int& offset, const ImVec2
if( m_showFull ) if( m_showFull )
{ {
DrawLine( draw, dpos + ImVec2( 0, hdrOffset + ty - 1 ), dpos + ImVec2( w, hdrOffset + ty - 1 ), HeaderLineColor() ); DrawLine( draw, dpos + ImVec2( 0, hdrOffset + ty - 1 ), dpos + ImVec2( w, hdrOffset + ty - 1 ), HeaderLineColor() );
HeaderExtraContents( hdrOffset, wpos, labelWidth, hover ); HeaderExtraContents( hdrOffset, wpos, labelWidth, pxns, hover );
} }
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, hdrOffset ), wpos + ImVec2( ty + labelWidth, hdrOffset + ty ) ) ) if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, hdrOffset ), wpos + ImVec2( ty + labelWidth, hdrOffset + ty ) ) )

View File

@ -32,7 +32,7 @@ protected:
virtual const char* HeaderLabel() const = 0; virtual const char* HeaderLabel() const = 0;
virtual void HeaderTooltip( const char* label ) const {}; virtual void HeaderTooltip( const char* label ) const {};
virtual void HeaderExtraContents( int offset, const ImVec2& wpos, float labelWidth, bool hover ) {}; virtual void HeaderExtraContents( int offset, const ImVec2& wpos, float labelWidth, double pxns, bool hover ) {};
virtual int64_t RangeBegin() const = 0; virtual int64_t RangeBegin() const = 0;
virtual int64_t RangeEnd() const = 0; virtual int64_t RangeEnd() const = 0;

View File

@ -81,7 +81,7 @@ void TimelineItemPlot::HeaderTooltip( const char* label ) const
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
void TimelineItemPlot::HeaderExtraContents( int offset, const ImVec2& wpos, float labelWidth, bool hover ) void TimelineItemPlot::HeaderExtraContents( int offset, const ImVec2& wpos, float labelWidth, double pxns, bool hover )
{ {
auto draw = ImGui::GetWindowDrawList(); auto draw = ImGui::GetWindowDrawList();
const auto ty = ImGui::GetTextLineHeight(); const auto ty = ImGui::GetTextLineHeight();

View File

@ -25,7 +25,7 @@ protected:
int64_t RangeEnd() const override; int64_t RangeEnd() const override;
void HeaderTooltip( const char* label ) const override; void HeaderTooltip( const char* label ) const override;
void HeaderExtraContents( int offset, const ImVec2& wpos, float labelWidth, bool hover ) override; void HeaderExtraContents( int offset, const ImVec2& wpos, float labelWidth, double pxns, bool hover ) override;
private: private:
PlotData* m_plot; PlotData* m_plot;