forked from blender/blender
main sync #3
@ -3754,16 +3754,6 @@ static void add_region_padding(bContext *C, bAnimContext *ac, rctf *bounds)
|
|||||||
BLI_rctf_pad_y(bounds, ac->region->winy, pad_bottom, pad_top);
|
BLI_rctf_pad_y(bounds, ac->region->winy, pad_bottom, pad_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ARegion *get_window_region(bAnimContext *ac)
|
|
||||||
{
|
|
||||||
LISTBASE_FOREACH (ARegion *, region, &ac->area->regionbase) {
|
|
||||||
if (region->regiontype == RGN_TYPE_WINDOW) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int graphkeys_view_selected_channels_exec(bContext *C, wmOperator *op)
|
static int graphkeys_view_selected_channels_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
@ -3772,8 +3762,7 @@ static int graphkeys_view_selected_channels_exec(bContext *C, wmOperator *op)
|
|||||||
if (ANIM_animdata_get_context(C, &ac) == 0) {
|
if (ANIM_animdata_get_context(C, &ac) == 0) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
ARegion *window_region = BKE_area_find_region_type(ac.area, RGN_TYPE_WINDOW);
|
||||||
ARegion *window_region = get_window_region(&ac);
|
|
||||||
|
|
||||||
if (!window_region) {
|
if (!window_region) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
@ -3869,7 +3858,7 @@ static int graphkeys_channel_view_pick_invoke(bContext *C, wmOperator *op, const
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
ARegion *window_region = get_window_region(&ac);
|
ARegion *window_region = BKE_area_find_region_type(ac.area, RGN_TYPE_WINDOW);
|
||||||
|
|
||||||
if (!window_region) {
|
if (!window_region) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "DNA_screen_types.h"
|
#include "DNA_screen_types.h"
|
||||||
|
|
||||||
#include "BKE_context.h"
|
#include "BKE_context.h"
|
||||||
|
#include "BKE_screen.h"
|
||||||
|
|
||||||
#include "BLI_blenlib.h"
|
#include "BLI_blenlib.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
@ -41,18 +42,6 @@
|
|||||||
/* Own include. */
|
/* Own include. */
|
||||||
#include "sequencer_intern.h"
|
#include "sequencer_intern.h"
|
||||||
|
|
||||||
static ARegion *timeline_region_get(const ScrArea *area)
|
|
||||||
{
|
|
||||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
|
||||||
if (region->regiontype == RGN_TYPE_WINDOW) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BLI_assert_unreachable();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static float draw_offset_get(const View2D *timeline_region_v2d)
|
static float draw_offset_get(const View2D *timeline_region_v2d)
|
||||||
{
|
{
|
||||||
return timeline_region_v2d->cur.ymin;
|
return timeline_region_v2d->cur.ymin;
|
||||||
@ -335,7 +324,8 @@ void channel_draw_context_init(const bContext *C,
|
|||||||
r_context->ed = SEQ_editing_get(r_context->scene);
|
r_context->ed = SEQ_editing_get(r_context->scene);
|
||||||
r_context->seqbase = SEQ_active_seqbase_get(r_context->ed);
|
r_context->seqbase = SEQ_active_seqbase_get(r_context->ed);
|
||||||
r_context->channels = SEQ_channels_displayed_get(r_context->ed);
|
r_context->channels = SEQ_channels_displayed_get(r_context->ed);
|
||||||
r_context->timeline_region = timeline_region_get(CTX_wm_area(C));
|
r_context->timeline_region = BKE_area_find_region_type(r_context->area, RGN_TYPE_WINDOW);
|
||||||
|
BLI_assert(r_context->timeline_region != NULL);
|
||||||
r_context->timeline_region_v2d = &r_context->timeline_region->v2d;
|
r_context->timeline_region_v2d = &r_context->timeline_region->v2d;
|
||||||
|
|
||||||
r_context->channel_height = channel_height_pixelspace_get(r_context->timeline_region_v2d);
|
r_context->channel_height = channel_height_pixelspace_get(r_context->timeline_region_v2d);
|
||||||
|
Loading…
Reference in New Issue
Block a user