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:
authorJeroen Bakker <j.bakker@atmind.nl>2012-07-10 16:23:49 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-07-10 16:23:49 +0400
commitdc65a26bf6216440d7470be900f3b211c49f22d4 (patch)
tree40d442aa5ae6681e8e9a9a8e2f33e374ce58e745 /source/blender/editors/space_node/node_draw.c
parent5cc0e5f751e2428db9ca3cf263f3a44f77a2bc5c (diff)
refactor node highlight code. New implementation will not write to
uninitialized memory. it happened when you delete a node that was being executed. in the compostor
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 89a4d92b295..7be76bd7884 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -80,6 +80,7 @@
#include "intern/node_util.h"
#include "node_intern.h"
+#include "COM_compositor.h"
/* width of socket columns in group display */
#define NODE_GROUP_FRAME 120
@@ -726,9 +727,8 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
if (ntree->type == NTREE_COMPOSIT && (snode->flag & SNODE_SHOW_HIGHLIGHT)) {
- if (node->highlight) {
+ if (COM_isHighlightedbNode(node)) {
UI_ThemeColorBlend(color_id, TH_ACTIVE, 0.5f);
- node->highlight = 0;
}
}
uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
@@ -893,9 +893,8 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
if (ntree->type == NTREE_COMPOSIT && (snode->flag & SNODE_SHOW_HIGHLIGHT)) {
- if (node->highlight) {
+ if (COM_isHighlightedbNode(node)) {
UI_ThemeColorBlend(color_id, TH_ACTIVE, 0.5f);
- node->highlight = 0;
}
}
@@ -1133,6 +1132,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
if (snode->nodetree) {
bNode *node;
+ void** highlights = 0;
node_uiblocks_init(C, snode->nodetree);
@@ -1145,6 +1145,9 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
}
node_update_nodetree(C, snode->nodetree, 0.0f, 0.0f);
+ if (snode->nodetree->type == NTREE_COMPOSIT) {
+ COM_startReadHighlights();
+ }
node_draw_nodetree(C, ar, snode, snode->nodetree);
#if 0