Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_utils.c
| Show First 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | |||||
| /* Find if x coordinate is over element disclosure toggle */ | /* Find if x coordinate is over element disclosure toggle */ | ||||
| bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x) | bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x) | ||||
| { | { | ||||
| return (view_co_x > te->xs) && (view_co_x < te->xs + UI_UNIT_X); | return (view_co_x > te->xs) && (view_co_x < te->xs + UI_UNIT_X); | ||||
| } | } | ||||
| /* Scroll view vertically while keeping within total bounds */ | /* Scroll view vertically while keeping within total bounds */ | ||||
| void outliner_scroll_view(ARegion *region, int delta_y) | void outliner_scroll_view(SpaceOutliner *space_outliner, ARegion *region, int delta_y) | ||||
| { | { | ||||
| int y_min = MIN2(region->v2d.cur.ymin, region->v2d.tot.ymin); | int tree_width, tree_height; | ||||
| outliner_tree_dimensions(space_outliner, &tree_width, &tree_height); | |||||
| int y_min = MIN2(region->v2d.cur.ymin, -tree_height); | |||||
| region->v2d.cur.ymax += delta_y; | region->v2d.cur.ymax += delta_y; | ||||
| region->v2d.cur.ymin += delta_y; | region->v2d.cur.ymin += delta_y; | ||||
| /* Adjust view if delta placed view outside total area */ | /* Adjust view if delta placed view outside total area */ | ||||
| int offset; | int offset; | ||||
| if (region->v2d.cur.ymax > -UI_UNIT_Y) { | if (region->v2d.cur.ymax > -UI_UNIT_Y) { | ||||
| offset = region->v2d.cur.ymax; | offset = region->v2d.cur.ymax; | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||