mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Next try to fix scroll the Object List to selected item (OSX & GTK)
This commit is contained in:
parent
907e510535
commit
880c1ef2b4
1 changed files with 5 additions and 2 deletions
|
@ -1460,9 +1460,12 @@ void ObjectList::update_selections()
|
|||
select_items(sels);
|
||||
|
||||
if (GetSelection()) {
|
||||
const wxRect& top_rc = GetItemRect(GetTopItem());
|
||||
const wxRect& sel_rc = GetItemRect(GetSelection());
|
||||
ScrollLines(int((sel_rc.y - top_rc.y) / top_rc.GetHeight()) - 0.5*GetCountPerPage());
|
||||
if (!sel_rc.IsEmpty()) {
|
||||
const int rc_h = sel_rc.height;
|
||||
const int displ = GetMainWindow()->GetClientRect().GetHeight()/(2*rc_h)+1;
|
||||
ScrollLines(int(sel_rc.y / rc_h - displ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue