Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_edit.c
| Show First 20 Lines • Show All 1,337 Lines • ▼ Show 20 Lines | if (active_element) { | ||||
| * though). */ | * though). */ | ||||
| outliner_show_active(space_outliner, region, active_element, id); | outliner_show_active(space_outliner, region, active_element, id); | ||||
| /* Center view on first element found */ | /* Center view on first element found */ | ||||
| int size_y = BLI_rcti_size_y(&v2d->mask) + 1; | int size_y = BLI_rcti_size_y(&v2d->mask) + 1; | ||||
| int ytop = (active_element->ys + (size_y / 2)); | int ytop = (active_element->ys + (size_y / 2)); | ||||
| int delta_y = ytop - v2d->cur.ymax; | int delta_y = ytop - v2d->cur.ymax; | ||||
| outliner_scroll_view(region, delta_y); | outliner_scroll_view(space_outliner, region, delta_y); | ||||
| } | } | ||||
| else { | else { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| ED_region_tag_redraw_no_rebuild(region); | ED_region_tag_redraw_no_rebuild(region); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| Show All 15 Lines | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name View Panning (Outliner) Operator | /** \name View Panning (Outliner) Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int outliner_scroll_page_exec(bContext *C, wmOperator *op) | static int outliner_scroll_page_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); | |||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| int size_y = BLI_rcti_size_y(®ion->v2d.mask) + 1; | int size_y = BLI_rcti_size_y(®ion->v2d.mask) + 1; | ||||
| bool up = RNA_boolean_get(op->ptr, "up"); | bool up = RNA_boolean_get(op->ptr, "up"); | ||||
| if (!up) { | if (!up) { | ||||
| size_y = -size_y; | size_y = -size_y; | ||||
| } | } | ||||
| outliner_scroll_view(region, size_y); | outliner_scroll_view(space_outliner, region, size_y); | ||||
| ED_region_tag_redraw_no_rebuild(region); | ED_region_tag_redraw_no_rebuild(region); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void OUTLINER_OT_scroll_page(wmOperatorType *ot) | void OUTLINER_OT_scroll_page(wmOperatorType *ot) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 970 Lines • Show Last 20 Lines | |||||