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
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-12-05 05:03:37 +0300
committerJoshua Leung <aligorith@gmail.com>2008-12-05 05:03:37 +0300
commit5e6041496174904e1745b39517b63b0dff78326b (patch)
tree204d9735a8abb407d03a4e7a09acfdc9268f6ca0 /source/blender/editors/space_outliner
parente4a8a39f9d649a2fc022959ef8bbee147422a38e (diff)
View2D API: Cleaning up API + New Methods
* Cleaned up flags defined for View2D, and added some for defining the alignment of the view's data in the 'tot' rect (i.e. which quadrant(s) the view data is allowed to reside in). * These flags are used in the new UI_view2d_totRect_set() function, which sets the new size of the 'tot' rect (i.e. the maximum viewable area). Currently, is only used for Outliner, but channel-lists also require this. * Added API method to reset 'cur' (current viewing region) to 'default' viewing region - UI_view2d_curRect_reset(). Currently, 'keepzoom' is not respected. I'll check on whether this is needed when I recode UI_view2d_status_enforce(), which is badly in need of a cleanup.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 2518d809d29..b00572cc7b0 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -346,12 +346,11 @@ static void outliner_main_area_draw(const bContext *C, ARegion *ar)
UI_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT);
-
- // XXX width should be depend on max length of items (like height)...
+
awidth= width= ar->winrct.xmax - ar->winrct.xmin + 1;
aheight= height= ar->winrct.ymax - ar->winrct.ymin + 1;
- UI_view2d_update_size(v2d, awidth, aheight);
+ UI_view2d_size_update(v2d, awidth, aheight);
/* create table */
cell.space= soutliner;
@@ -397,11 +396,8 @@ static void outliner_main_area_draw(const bContext *C, ARegion *ar)
width= (cols + 1) * COLUMN_WIDTH;
/* need to validate view2d after updating size of tot */
- v2d->tot.xmin= 0;
- v2d->tot.xmax= width;
- v2d->tot.ymax= 0;
- v2d->tot.ymin= -height;
- UI_view2d_enforce_status(v2d, awidth, aheight);
+ UI_view2d_totRect_set(v2d, width, height);
+ UI_view2d_status_enforce(v2d, awidth, aheight);
rct.xmin= 0;
rct.ymin= -height;