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

Refactor the use of offset in TimelineItem::Draw() and TimelineController::End().

This commit is contained in:
Tomaž Vöröš
2023-01-27 20:00:05 +01:00
parent 52b6af88ca
commit 7b9b810421
5 changed files with 37 additions and 30 deletions
+6 -2
View File
@@ -17,7 +17,8 @@ public:
TimelineItem( View& view, Worker& worker );
virtual ~TimelineItem() = default;
void Draw( bool firstFrame, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax );
// draws the timeilne item and also updates the next frame height value
void Draw( bool firstFrame, double pxns, int yOffset, const ImVec2& wpos, bool hover, float yMin, float yMax );
void VisibilityCheckbox();
virtual void SetVisible( bool visible ) { m_visible = visible; }
@@ -25,6 +26,9 @@ public:
void SetShowFull( bool showFull ) { m_showFull = showFull; }
// returns 0 instead of the correct value for the first frame
int GetNextFrameHeight() const { return m_height; }
protected:
virtual uint32_t HeaderColor() const = 0;
virtual uint32_t HeaderColorInactive() const = 0;
@@ -46,7 +50,7 @@ protected:
bool m_showFull;
private:
void AdjustThreadHeight( bool firstFrame, int oldOffset, int& offset );
void AdjustThreadHeight( bool firstFrame, int yBegin, int yEnd );
int m_height;