Commit c81123a3 authored by twanvl's avatar twanvl

next time, save before you commit...

parent bb69b4a8
...@@ -263,30 +263,13 @@ void TreeList::onLeftDClick(wxMouseEvent& ev) { ...@@ -263,30 +263,13 @@ void TreeList::onLeftDClick(wxMouseEvent& ev) {
// ----------------------------------------------------------------------------- : TreeList : Copy of VScrolledWindow // ----------------------------------------------------------------------------- : TreeList : Copy of VScrolledWindow
void TreeList::ScrollToLine(size_t line) { void TreeList::ScrollToLine(size_t line) {
// Based on VScrolledWindow::ScrollToLine
// determine the real first line to scroll to: we shouldn't scroll beyond the end // determine the real first line to scroll to: we shouldn't scroll beyond the end
line = (size_t)min((int)line, (int)(total_lines - visible_lines_t)); line = (size_t)min((int)line, (int)(total_lines - visible_lines_t));
// nothing to do?
// nothing to do?
if (line == first_line) return; if (line == first_line) return;
//%size_t first_line_old = first_line;
first_line = line; first_line = line;
UpdateScrollbar(); UpdateScrollbar();
Refresh(false);
Refresh(false);
/*
// finally refresh the display -- but only redraw as few lines as possible to avoid flicker
wxSize cs = GetClientSize();
int dy = (int)(first_line_old - first_line) * item_height;
if (abs(dy) >= cs.y - header_height) {
Refresh(false);
} else {
wxRect rect(0, header_height, cs.x, cs.y - header_height);
ScrollWindow(0, dy, &rect);
}*/
} }
void TreeList::UpdateScrollbar() { void TreeList::UpdateScrollbar() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment