Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.cc
| Show First 20 Lines • Show All 2,175 Lines • ▼ Show 20 Lines | static void draw_nodetree(const bContext *C, | |||||||||
| node_draw_nodetree(C, region, snode, ntree, parent_key); | node_draw_nodetree(C, region, snode, ntree, parent_key); | |||||||||
| } | } | |||||||||
| /** | /** | |||||||||
| * Make the background slightly brighter to indicate that users are inside a nodegroup. | * Make the background slightly brighter to indicate that users are inside a nodegroup. | |||||||||
| */ | */ | |||||||||
| static void draw_background_color(const SpaceNode *snode) | static void draw_background_color(const SpaceNode *snode) | |||||||||
| { | { | |||||||||
| const int max_depth = 2; | const int max_depth = 3; | |||||||||
sergeyUnsubmitted Not Done Inline Actions
sergey: | ||||||||||
| const float bright_factor = 0.25f; | const float bright_factor = 0.25f; | |||||||||
| const int depth = BLI_listbase_count_at_most(&snode->treepath, max_depth); | const int depth = BLI_listbase_count_at_most(&snode->treepath, max_depth) - 1; | |||||||||
Done Inline ActionsPut an explicit explanation that we want to ignore the first element of the path (as it is the top-most tree which does not need tinting), and that we don't want to go too far in the list. The name num_parents is a bit ambiguous. I.e. how many parents you expect to be in the A -> B list? Technically there is only one parent, as the B has no children. But the code will return 2. clamped_tree_path_length is what denotes the content of the variable the best. sergey: Put an explicit explanation that we want to ignore the first element of the path (as it is the… | ||||||||||
Done Inline Actions
Avoid macro whenever possible! sergey: Avoid macro whenever possible! | ||||||||||
| float color[3]; | float color[3]; | |||||||||
| UI_GetThemeColor3fv(TH_BACK, color); | UI_GetThemeColor3fv(TH_BACK, color); | |||||||||
| mul_v3_fl(color, 1.0f + bright_factor * depth); | mul_v3_fl(color, 1.0f + bright_factor * depth); | |||||||||
| GPU_clear_color(color[0], color[1], color[2], 1.0); | GPU_clear_color(color[0], color[1], color[2], 1.0); | |||||||||
| } | } | |||||||||
| void node_draw_space(const bContext *C, ARegion *region) | void node_draw_space(const bContext *C, ARegion *region) | |||||||||
| { | { | |||||||||
| ▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines | ||||||||||