mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 02:52:10 +00:00
Next try to fix scroll the Object List to selected item (OSX & GTK)
This commit is contained in:
@@ -1460,9 +1460,12 @@ void ObjectList::update_selections()
|
|||||||
select_items(sels);
|
select_items(sels);
|
||||||
|
|
||||||
if (GetSelection()) {
|
if (GetSelection()) {
|
||||||
const wxRect& top_rc = GetItemRect(GetTopItem());
|
|
||||||
const wxRect& sel_rc = GetItemRect(GetSelection());
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user