Dynamically adapt find zone results to range limit.

This commit is contained in:
Bartosz Taudul 2020-07-29 18:48:49 +02:00
parent c1bf853310
commit 58428e7ede
2 changed files with 16 additions and 2 deletions

View File

@ -8979,7 +8979,6 @@ void View::DrawFindZone()
ImGui::SameLine();
if( ImGui::Checkbox( "Limit range", &m_findZone.range.active ) )
{
m_findZone.ResetMatch();
if( m_findZone.range.active )
{
m_findZone.range.min = m_vd.zvStart;
@ -9000,12 +8999,17 @@ void View::DrawFindZone()
ImGui::SameLine();
if( ImGui::SmallButton( "Limit to view" ) )
{
m_findZone.ResetMatch();
m_findZone.range.min = m_vd.zvStart;
m_findZone.range.max = m_vd.zvEnd;
}
}
if( m_findZone.rangeSlim != m_findZone.range )
{
m_findZone.ResetMatch();
m_findZone.rangeSlim = m_findZone.range;
}
if( findClicked )
{
m_findZone.Reset();

View File

@ -68,6 +68,15 @@ class View
bool modMax = false;
};
struct RangeSlim
{
bool operator==( const Range& other ) const { return other.active == active && other.min == min && other.max == max; }
void operator=( const Range& other ) { active = other.active; min = other.min; max = other.max; }
int64_t min, max;
bool active = false;
};
public:
struct VisData
{
@ -501,6 +510,7 @@ private:
int64_t tmin, tmax;
bool showZoneInFrames = false;
Range range;
RangeSlim rangeSlim;
struct
{