We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80f117d commit 3e42aafCopy full SHA for 3e42aaf
src/TSMapEditor/UI/Sidebar/TreeView.cs
@@ -226,12 +226,17 @@ public void FindNode(string text, bool findNext)
226
SelectedNode = foundNode;
227
228
// Scroll the view to the found item
229
- int totalHeight = GetTotalContentHeight();
230
- if (accumulatedHeight + Height > totalHeight)
231
- accumulatedHeight = totalHeight - Height;
+ int contentHeight = GetTotalContentHeight();
+ if (accumulatedHeight + LineHeight + MARGIN > ViewTop + Height)
+ {
232
+ ViewTop += accumulatedHeight + LineHeight + MARGIN - (ViewTop + Height);
233
+ }
234
+ else if (accumulatedHeight < ViewTop)
235
236
+ ViewTop = accumulatedHeight - LineHeight;
237
238
239
RefreshScrollbar();
- ViewTop = accumulatedHeight;
240
}
241
242
0 commit comments