mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
More correct shouldUpdateCenterItem
.
This commit is contained in:
parent
ea1a0299f3
commit
645d53f254
@ -89,10 +89,12 @@ std::optional<int> TimelineController::CalculateScrollPosition() const
|
|||||||
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 )
|
||||||
{
|
{
|
||||||
auto shouldUpdateCenterItem = [&] () {
|
auto shouldUpdateCenterItem = [&] () {
|
||||||
|
const auto imguiChangedScroll = m_scroll != ImGui::GetScrollY();
|
||||||
const auto& mouseDelta = ImGui::GetIO().MouseDelta;
|
const auto& mouseDelta = ImGui::GetIO().MouseDelta;
|
||||||
const auto mouseMoved = mouseDelta.x != 0.0f || mouseDelta.y != 0.0f;
|
const auto mouseMoved = mouseDelta.x != 0.0f || mouseDelta.y != 0.0f;
|
||||||
const auto imguiChangedScroll = m_scroll != ImGui::GetScrollY();
|
const auto& mousePos = ImGui::GetIO().MousePos;
|
||||||
return ( ( imguiChangedScroll || mouseMoved ) && !ImGui::IsMouseDown( 1 ) ) || !m_centerItemkey;
|
const auto mouseVisible = ImGui::IsMousePosValid( &mousePos );
|
||||||
|
return ( ( imguiChangedScroll || mouseMoved || !mouseVisible ) && !ImGui::IsMouseDown( 1 ) ) || !m_centerItemkey;
|
||||||
};
|
};
|
||||||
|
|
||||||
if( !vcenter )
|
if( !vcenter )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user