mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-13 03:41:48 +00:00
Fix vertical panning.
This commit is contained in:
parent
f07eebebf7
commit
251e8f1fe2
@ -1902,6 +1902,7 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
|||||||
m_zoomAnim.active = false;
|
m_zoomAnim.active = false;
|
||||||
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
||||||
const auto delta = GetMouseDragDelta( 1 );
|
const auto delta = GetMouseDragDelta( 1 );
|
||||||
|
m_yDelta = delta.y;
|
||||||
const auto dpx = int64_t( (delta.x * nspx) + (hwheel_delta * nspx));
|
const auto dpx = int64_t( (delta.x * nspx) + (hwheel_delta * nspx));
|
||||||
if( dpx != 0 )
|
if( dpx != 0 )
|
||||||
{
|
{
|
||||||
@ -1922,12 +1923,6 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
|||||||
m_vd.zvStart = m_vd.zvEnd - range;
|
m_vd.zvStart = m_vd.zvEnd - range;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( delta.y != 0 )
|
|
||||||
{
|
|
||||||
auto y = ImGui::GetScrollY();
|
|
||||||
ImGui::SetScrollY( y - delta.y );
|
|
||||||
io.MouseClickedPos[1].y = io.MousePos.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto wheel = io.MouseWheel;
|
const auto wheel = io.MouseWheel;
|
||||||
@ -2434,6 +2429,7 @@ void View::DrawZones()
|
|||||||
m_zoneHover2.Decay( nullptr );
|
m_zoneHover2.Decay( nullptr );
|
||||||
m_findZone.range.StartFrame();
|
m_findZone.range.StartFrame();
|
||||||
m_statRange.StartFrame();
|
m_statRange.StartFrame();
|
||||||
|
m_yDelta = 0;
|
||||||
|
|
||||||
if( m_vd.zvStart == m_vd.zvEnd ) return;
|
if( m_vd.zvStart == m_vd.zvEnd ) return;
|
||||||
assert( m_vd.zvStart < m_vd.zvEnd );
|
assert( m_vd.zvStart < m_vd.zvEnd );
|
||||||
@ -2494,6 +2490,14 @@ void View::DrawZones()
|
|||||||
|
|
||||||
ImGui::BeginChild( "##zoneWin", ImVec2( ImGui::GetWindowContentRegionWidth(), ImGui::GetContentRegionAvail().y ), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
ImGui::BeginChild( "##zoneWin", ImVec2( ImGui::GetWindowContentRegionWidth(), ImGui::GetContentRegionAvail().y ), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
||||||
|
|
||||||
|
if( m_yDelta != 0 )
|
||||||
|
{
|
||||||
|
auto& io = ImGui::GetIO();
|
||||||
|
auto y = ImGui::GetScrollY();
|
||||||
|
ImGui::SetScrollY( y - m_yDelta );
|
||||||
|
io.MouseClickedPos[1].y = io.MousePos.y;
|
||||||
|
}
|
||||||
|
|
||||||
const auto wpos = ImGui::GetCursorScreenPos();
|
const auto wpos = ImGui::GetCursorScreenPos();
|
||||||
const auto h = std::max<float>( m_vd.zvHeight, ImGui::GetContentRegionAvail().y - 4 ); // magic border value
|
const auto h = std::max<float>( m_vd.zvHeight, ImGui::GetContentRegionAvail().y - 4 ); // magic border value
|
||||||
|
|
||||||
|
@ -446,6 +446,7 @@ private:
|
|||||||
|
|
||||||
bool m_reconnectRequested = false;
|
bool m_reconnectRequested = false;
|
||||||
int m_firstFrame = 10;
|
int m_firstFrame = 10;
|
||||||
|
float m_yDelta;
|
||||||
|
|
||||||
std::vector<SourceRegex> m_sourceSubstitutions;
|
std::vector<SourceRegex> m_sourceSubstitutions;
|
||||||
bool m_sourceRegexValid = true;
|
bool m_sourceRegexValid = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user