File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,8 @@ s32 GUITable::getSelected() const
556
556
557
557
void GUITable::setSelected (s32 index)
558
558
{
559
+ s32 old_selected = m_selected;
560
+
559
561
m_selected = -1 ;
560
562
m_sel_column = 0 ;
561
563
m_sel_doubleclick = false ;
@@ -572,7 +574,8 @@ void GUITable::setSelected(s32 index)
572
574
}
573
575
574
576
// If the selected row is not visible, open its ancestors to make it visible
575
- if (m_rows[index ].visible_index < 0 ) {
577
+ bool selection_invisible = m_rows[index ].visible_index < 0 ;
578
+ if (selection_invisible) {
576
579
std::set<s32> opened_trees;
577
580
getOpenedTrees (opened_trees);
578
581
s32 indent = m_rows[index ].indent ;
@@ -590,7 +593,9 @@ void GUITable::setSelected(s32 index)
590
593
assert (m_selected >= 0 && m_selected < (s32) m_visible_rows.size ());
591
594
}
592
595
593
- autoScroll ();
596
+ if (m_selected != old_selected || selection_invisible) {
597
+ autoScroll ();
598
+ }
594
599
}
595
600
596
601
GUITable::DynamicData GUITable::getDynamicData () const
You can’t perform that action at this time.
0 commit comments