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:
authorTon Roosendaal <ton@blender.org>2009-07-02 22:12:46 +0400
committerTon Roosendaal <ton@blender.org>2009-07-02 22:12:46 +0400
commit5a0896e1a3c7f17abd37e3d818585fde8e80ff6d (patch)
tree6a53f54cceb0909e255f286e95a356653b2afcad /source/blender/editors/space_graph
parentaefa7b626a5e623b5f98979a5cc849b7c21563cc (diff)
2.5
Cleanup of scroller drawing in 2D windows. Before: http://download.blender.org/institute/rt11.jpg After: http://download.blender.org/institute/rt12.jpg Will add 'zoom' widget circles later, as mockupped here: http://www.reynish.com/files/blender25/fcurve_scrollbar.png Also note the scale values are inside scroller; drawing it on top conflicts with current frame item and markers. Currently scroller disappear entirely when view is total. For Joshua: To make sliders behave nicely, the boundbox (v2d->tot) has to be refreshed on each change. I've added it in graph drawing now, but it could be notifier based I guess... not sure what the correct anim api call would be. Can discuss tomorrow! On todo: Layout config hints so people can make scroller positions swap.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_edit.c5
-rw-r--r--source/blender/editors/space_graph/graph_intern.h2
-rw-r--r--source/blender/editors/space_graph/space_graph.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index b624d02a633..23e8a009274 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -94,14 +94,15 @@
/* *************************** Calculate Range ************************** */
/* Get the min/max keyframes*/
-static void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax)
+/* note: it should return total boundbox, filter for selection only can be argument... */
+void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
/* get data to filter, from Dopesheet */
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* set large values to try to override */
diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h
index 7ba636302a5..e31adf7a7c8 100644
--- a/source/blender/editors/space_graph/graph_intern.h
+++ b/source/blender/editors/space_graph/graph_intern.h
@@ -82,6 +82,8 @@ enum {
/* ***************************************** */
/* graph_edit.c */
+void get_graph_keyframe_extents (struct bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax);
+
void GRAPHEDIT_OT_previewrange_set(struct wmOperatorType *ot);
void GRAPHEDIT_OT_view_all(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 74002f64187..1c977724767 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -243,6 +243,10 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar)
/* draw curves twice - unselected, then selected, so that the are fewer occlusion problems */
graph_draw_curves(&ac, sipo, ar, grid, 0);
graph_draw_curves(&ac, sipo, ar, grid, 1);
+
+ /* XXX the slow way to set tot rect... but for nice sliders needed (ton) */
+ get_graph_keyframe_extents(&ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax);
+
}
/* only free grid after drawing data, as we need to use it to determine sampling rate */