diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2009-01-01 19:27:02 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2009-01-01 19:27:02 +0300 |
commit | 029b0c3ecf89323b7ee943e5c09fbde4ca2fbc60 (patch) | |
tree | 7d236e2ef0905d257236389f5823a432be88a4e7 /source/blender/editors/space_node/node_state.c | |
parent | fc7944f436657ce4a9a479aff3d5903b79bd6ede (diff) |
2.5 / Nodes
* HOMEKEY enabled (view all), made into operator.
Diffstat (limited to 'source/blender/editors/space_node/node_state.c')
-rw-r--r-- | source/blender/editors/space_node/node_state.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index fdd1bcf1073..088df34a05f 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -192,3 +192,29 @@ void NODE_OT_toggle_visibility(wmOperatorType *ot) prop = RNA_def_property(ot->srna, "mx", PROP_INT, PROP_NONE); prop = RNA_def_property(ot->srna, "my", PROP_INT, PROP_NONE); } + +static int node_fit_all_exec(bContext *C, wmOperator *op) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C); + snode_home(sa, ar, snode); + ED_region_tag_redraw(ar); + return OPERATOR_FINISHED; +} + +static int node_fit_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + return node_fit_all_exec(C, op); +} + +void NODE_OT_fit_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Fit All"; + ot->idname= "NODE_OT_fit_all"; + + /* api callbacks */ + ot->invoke= node_fit_all_invoke; + ot->poll= ED_operator_node_active; +}
\ No newline at end of file |