From 2d48f3e445ad4294cfe1a354629bf335117ba40d Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 10 Nov 2020 13:53:05 +0100 Subject: Fix 'outliner_scroll_view()' not reaching wanted element Scrolling to an item after opening relevant parents can go wrong if said parent e.g. the last in the list [as in: then the Outliner does not scroll down all the way] It stems from the fact that 'region->v2d.tot.ymin' is not up-to-date in outliner_scroll_view after outliner_show_active opens up parents, 'tot' will only update on a redraw. Now calculate the trees height on the fly using 'outliner_tree_dimensions()'. ref D9521 ref T82553 Maniphest Tasks: T82553 Differential Revision: https://developer.blender.org/D9523 --- source/blender/editors/space_outliner/outliner_intern.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner/outliner_intern.h') diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 382078f006b..d65dec54a20 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -251,6 +251,8 @@ TreeTraversalAction outliner_find_selected_objects(struct TreeElement *te, void void draw_outliner(const struct bContext *C); +void outliner_tree_dimensions(struct SpaceOutliner *space_outliner, int *r_width, int *r_height); + TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te); void outliner_collection_isolate_flag(struct Scene *scene, @@ -525,7 +527,7 @@ bool outliner_tree_traverse(const SpaceOutliner *space_outliner, float outliner_restrict_columns_width(const struct SpaceOutliner *space_outliner); TreeElement *outliner_find_element_with_flag(const ListBase *lb, short flag); bool outliner_is_element_visible(const TreeElement *te); -void outliner_scroll_view(struct ARegion *region, int delta_y); +void outliner_scroll_view(struct SpaceOutliner *space_outliner, struct ARegion *region, int delta_y); void outliner_tag_redraw_avoid_rebuild_on_open_change(const struct SpaceOutliner *space_outliner, struct ARegion *region); -- cgit v1.2.3