[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18019] branches/blender2.5/blender/source /blender/editors: 2.5 - Bugfixes
Joshua Leung
aligorith at gmail.com
Mon Dec 22 23:59:51 CET 2008
Revision: 18019
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18019
Author: aligorith
Date: 2008-12-22 23:59:48 +0100 (Mon, 22 Dec 2008)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/interface/view2d.c
branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c
Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c 2008-12-22 20:53:38 UTC (rev 18018)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c 2008-12-22 22:59:48 UTC (rev 18019)
@@ -562,7 +562,7 @@
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 @@
}
/* 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 */
Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c 2008-12-22 20:53:38 UTC (rev 18018)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c 2008-12-22 22:59:48 UTC (rev 18019)
@@ -101,6 +101,8 @@
/* 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 @@
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 @@
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 */
Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_header.c 2008-12-22 20:53:38 UTC (rev 18018)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_header.c 2008-12-22 22:59:48 UTC (rev 18019)
@@ -329,66 +329,68 @@
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, "");
+ 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;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, action_selectmenu, CTX_wm_area(C),
- "Select", 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_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, "");
+ }
+
+ 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;
-
- 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;
- }
}
+ 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);
-
+ 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 */
More information about the Bf-blender-cvs
mailing list