mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-04 04:19:15 +00:00
Start extracting timeline height control logic.
This commit is contained in:
29
server/TracyTimelineController.cpp
Normal file
29
server/TracyTimelineController.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "imgui.h"
|
||||
|
||||
#include "TracyTimelineController.hpp"
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
TimelineController::TimelineController()
|
||||
: m_height( 0 )
|
||||
, m_offset( 0 )
|
||||
, m_scroll( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
void TimelineController::End( float offset )
|
||||
{
|
||||
const auto scrollPos = ImGui::GetScrollY();
|
||||
if( scrollPos == 0 && m_scroll != 0 )
|
||||
{
|
||||
m_height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( offset > m_height ) m_height = offset;
|
||||
}
|
||||
m_scroll = scrollPos;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user