Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d.c
| Show First 20 Lines • Show All 864 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* ------------------ */ | /* ------------------ */ | ||||
| /* Called by menus to activate it, or by view2d operators | /* Called by menus to activate it, or by view2d operators | ||||
| * to make sure 'related' views stay in synchrony */ | * to make sure 'related' views stay in synchrony */ | ||||
| void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) | void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) | ||||
| { | { | ||||
| ARegion *region; | |||||
| /* don't continue if no view syncing to be done */ | /* don't continue if no view syncing to be done */ | ||||
| if ((v2dcur->flag & (V2D_VIEWSYNC_SCREEN_TIME | V2D_VIEWSYNC_AREA_VERTICAL)) == 0) { | if ((v2dcur->flag & (V2D_VIEWSYNC_SCREEN_TIME | V2D_VIEWSYNC_AREA_VERTICAL)) == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* check if doing within area syncing (i.e. channels/vertical) */ | /* check if doing within area syncing (i.e. channels/vertical) */ | ||||
| if ((v2dcur->flag & V2D_VIEWSYNC_AREA_VERTICAL) && (area)) { | if ((v2dcur->flag & V2D_VIEWSYNC_AREA_VERTICAL) && (area)) { | ||||
| for (region = area->regionbase.first; region; region = region->next) { | LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | ||||
| /* don't operate on self */ | /* don't operate on self */ | ||||
| if (v2dcur != ®ion->v2d) { | if (v2dcur != ®ion->v2d) { | ||||
| /* only if view has vertical locks enabled */ | /* only if view has vertical locks enabled */ | ||||
| if (region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) { | if (region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) { | ||||
| if (flag == V2D_LOCK_COPY) { | if (flag == V2D_LOCK_COPY) { | ||||
| /* other views with locks on must copy active */ | /* other views with locks on must copy active */ | ||||
| region->v2d.cur.ymin = v2dcur->cur.ymin; | region->v2d.cur.ymin = v2dcur->cur.ymin; | ||||
| region->v2d.cur.ymax = v2dcur->cur.ymax; | region->v2d.cur.ymax = v2dcur->cur.ymax; | ||||
| Show All 9 Lines | LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* check if doing whole screen syncing (i.e. time/horizontal) */ | /* check if doing whole screen syncing (i.e. time/horizontal) */ | ||||
| if ((v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) && (screen)) { | if ((v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) && (screen)) { | ||||
| LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) { | LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) { | ||||
| for (region = area_iter->regionbase.first; region; region = region->next) { | LISTBASE_FOREACH (ARegion *, region, &area_iter->regionbase) { | ||||
| /* don't operate on self */ | /* don't operate on self */ | ||||
| if (v2dcur != ®ion->v2d) { | if (v2dcur != ®ion->v2d) { | ||||
| /* only if view has horizontal locks enabled */ | /* only if view has horizontal locks enabled */ | ||||
| if (region->v2d.flag & V2D_VIEWSYNC_SCREEN_TIME) { | if (region->v2d.flag & V2D_VIEWSYNC_SCREEN_TIME) { | ||||
| if (flag == V2D_LOCK_COPY) { | if (flag == V2D_LOCK_COPY) { | ||||
| /* other views with locks on must copy active */ | /* other views with locks on must copy active */ | ||||
| region->v2d.cur.xmin = v2dcur->cur.xmin; | region->v2d.cur.xmin = v2dcur->cur.xmin; | ||||
| region->v2d.cur.xmax = v2dcur->cur.xmax; | region->v2d.cur.xmax = v2dcur->cur.xmax; | ||||
| ▲ Show 20 Lines • Show All 1,320 Lines • Show Last 20 Lines | |||||