Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-12-23 01:59:48 +0300
committerJoshua Leung <aligorith@gmail.com>2008-12-23 01:59:48 +0300
commit892be750e58e9824b573a86d8a2c49e43ddbbfd3 (patch)
treef2ebfdfedd7156c455b7d1ca95a648268b08ab11 /source
parent261d1308723d49b20a36338f4aaedbedbff1d960 (diff)
2.5 - Bugfixes
* View Pan Operator now stores area, etc. values from context in case user moves out of view * Moved the invalid-context check for Action Editor so that mode can still be changed when there's no data to show.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/view2d.c4
-rw-r--r--source/blender/editors/interface/view2d_ops.c8
-rw-r--r--source/blender/editors/space_action/action_header.c112
3 files changed, 65 insertions, 59 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 3d8b4fa959a..f827d68f697 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -562,7 +562,7 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
return;
/* check if doing within area syncing (i.e. channels/vertical) */
- if (v2dcur->flag & V2D_VIEWSYNC_AREA_VERTICAL) {
+ if ((v2dcur->flag & V2D_VIEWSYNC_AREA_VERTICAL) && (area)) {
for (ar= area->regionbase.first; ar; ar= ar->next) {
/* don't operate on self */
if (v2dcur != &ar->v2d) {
@@ -587,7 +587,7 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
}
/* check if doing whole screen syncing (i.e. time/horizontal) */
- if (v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) {
+ if ((v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) && (screen)) {
for (sa= screen->areabase.first; sa; sa= sa->next) {
for (ar= sa->regionbase.first; ar; ar= ar->next) {
/* don't operate on self */
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index e6dbcd60023..132413477f1 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -101,6 +101,8 @@ static short mouse_in_v2d_scrollers (const bContext *C, View2D *v2d, int x, int
/* temp customdata for operator */
typedef struct v2dViewPanData {
+ bScreen *sc; /* screen where view pan was initiated */
+ ScrArea *sa; /* area where view pan was initiated */
View2D *v2d; /* view2d we're operating in */
float facx, facy; /* amount to move view relative to zoom */
@@ -129,6 +131,8 @@ static int view_pan_init(bContext *C, wmOperator *op)
op->customdata= vpd;
/* set pointers to owners */
+ vpd->sc= CTX_wm_screen(C);
+ vpd->sa= CTX_wm_area(C);
vpd->v2d= v2d= &ar->v2d;
/* calculate translation factor - based on size of view */
@@ -165,8 +169,8 @@ static void view_pan_apply(bContext *C, wmOperator *op)
UI_view2d_curRect_validate(v2d);
/* request updates to be done... */
- ED_area_tag_redraw(CTX_wm_area(C));
- UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY);
+ ED_area_tag_redraw(vpd->sa);
+ UI_view2d_sync(vpd->sc, vpd->sa, v2d, V2D_LOCK_COPY);
}
/* cleanup temp customdata */
diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c
index a81e95f7dc9..635a40037b3 100644
--- a/source/blender/editors/space_action/action_header.c
+++ b/source/blender/editors/space_action/action_header.c
@@ -329,66 +329,68 @@ void action_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS);
/* get context... (also syncs data) */
- if ((ANIM_animdata_get_context(C, &ac)) && (ac.data)) {
- if ((sa->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, action_viewmenu, CTX_wm_area(C),
- "View", xco, yco, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, action_selectmenu, CTX_wm_area(C),
- "Select", xco, yco, xmax-3, 24, "");
+ ANIM_animdata_get_context(C, &ac);
+
+ if ((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, action_viewmenu, CTX_wm_area(C),
+ "View", xco, yco, xmax-3, 24, "");
+ xco+= xmax;
+
+ xmax= GetButStringLength("Select");
+ uiDefPulldownBut(block, action_selectmenu, CTX_wm_area(C),
+ "Select", xco, yco, xmax-3, 24, "");
+ xco+= xmax;
+
+ if ( (saction->mode == SACTCONT_DOPESHEET) ||
+ ((saction->action) && (saction->mode==SACTCONT_ACTION)) )
+ {
+ xmax= GetButStringLength("Channel");
+ uiDefPulldownBut(block, action_channelmenu, CTX_wm_area(C),
+ "Channel", xco, yco, xmax-3, 24, "");
xco+= xmax;
-
- if ( (saction->mode == SACTCONT_DOPESHEET) ||
- ((saction->action) && (saction->mode==SACTCONT_ACTION)) )
- {
- xmax= GetButStringLength("Channel");
- uiDefPulldownBut(block, action_channelmenu, CTX_wm_area(C),
- "Channel", xco, yco, xmax-3, 24, "");
- xco+= xmax;
- }
- else if (saction->mode==SACTCONT_GPENCIL) {
- xmax= GetButStringLength("Channel");
- uiDefPulldownBut(block, action_gplayermenu, CTX_wm_area(C),
- "Channel", xco, yco, xmax-3, 24, "");
- xco+= xmax;
- }
-
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block, action_markermenu, CTX_wm_area(C),
- "Marker", xco, yco, xmax-3, 24, "");
+ }
+ else if (saction->mode==SACTCONT_GPENCIL) {
+ xmax= GetButStringLength("Channel");
+ uiDefPulldownBut(block, action_gplayermenu, CTX_wm_area(C),
+ "Channel", xco, yco, xmax-3, 24, "");
xco+= xmax;
-
- if (saction->mode == SACTCONT_GPENCIL) {
- xmax= GetButStringLength("Frame");
- uiDefPulldownBut(block, action_framemenu, CTX_wm_area(C),
- "Frame", xco, yco, xmax-3, 24, "");
- xco+= xmax;
- }
- else {
- xmax= GetButStringLength("Key");
- uiDefPulldownBut(block, action_keymenu, CTX_wm_area(C),
- "Key", xco, yco, xmax-3, 24, "");
- xco+= xmax;
- }
}
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* MODE SELECTOR */
- uiDefButC(block, MENU, B_REDR,
- "Editor Mode %t|DopeSheet %x3|Action Editor %x0|ShapeKey Editor %x1|Grease Pencil %x2",
- xco,yco,90,YIC, &saction->mode, 0, 1, 0, 0,
- "Editing modes for this editor");
-
- xco += (90 + 8);
+ xmax= GetButStringLength("Marker");
+ uiDefPulldownBut(block, action_markermenu, CTX_wm_area(C),
+ "Marker", xco, yco, xmax-3, 24, "");
+ xco+= xmax;
+ if (saction->mode == SACTCONT_GPENCIL) {
+ xmax= GetButStringLength("Frame");
+ uiDefPulldownBut(block, action_framemenu, CTX_wm_area(C),
+ "Frame", xco, yco, xmax-3, 24, "");
+ xco+= xmax;
+ }
+ else {
+ xmax= GetButStringLength("Key");
+ uiDefPulldownBut(block, action_keymenu, CTX_wm_area(C),
+ "Key", xco, yco, xmax-3, 24, "");
+ xco+= xmax;
+ }
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* MODE SELECTOR */
+ uiDefButC(block, MENU, B_REDR,
+ "Editor Mode %t|DopeSheet %x3|Action Editor %x0|ShapeKey Editor %x1|Grease Pencil %x2",
+ xco,yco,90,YIC, &saction->mode, 0, 1, 0, 0,
+ "Editing modes for this editor");
+
+
+ xco += (90 + 8);
+
+ if (ac.data) {
/* MODE-DEPENDENT DRAWING */
if (saction->mode == SACTCONT_DOPESHEET) {
/* FILTERING OPTIONS */