Bugfix in connectionpoint selection. Removed node wasn't removed from selection list

parent f725cf84
......@@ -293,6 +293,21 @@ void FlowCtx::conpoint_select( FlowArrayElem *node, int cp_num)
conpoint_select_idx++;
}
void FlowCtx::conpoint_select_remove( FlowArrayElem *node)
{
// Remove all occurences of the node
for ( int i = 0; i < conpoint_select_idx; i++) {
if ( conpoint_select_node[i] == node) {
// Hit, remove node
for ( int j = i; j < conpoint_select_idx - 1; j++) {
conpoint_select_node[j] = conpoint_select_node[j+1];
conpoint_select_num[j] = conpoint_select_num[j+1];
}
conpoint_select_idx--;
}
}
}
void FlowCtx::conpoint_select_clear()
{
if ( conpoint_select_idx >= 1)
......
......@@ -120,6 +120,7 @@ class FlowCtx {
void con_create_source( FlowArrayElem *node, int cp_num, int cp_x, int cp_y);
void con_create_dest( FlowArrayElem *node, int cp_num, flow_eEvent event, int x, int y);
void conpoint_select( FlowArrayElem *node, int cp_num);
void conpoint_select_remove( FlowArrayElem *node);
void conpoint_select_clear();
void get_selectlist( FlowArrayElem ***list, int *size)
{ *list = a_sel.a; *size = a_sel.size();};
......
......@@ -93,6 +93,7 @@ FlowNode::~FlowNode()
ctx->set_defered_redraw();
ctx->delete_node_cons( this);
ctx->conpoint_select_remove( this);
ctx->draw( int(x_left * ctx->zoom_factor - ctx->offset_x - 20),
int(y_low * ctx->zoom_factor - ctx->offset_y - 20),
int(x_right * ctx->zoom_factor - ctx->offset_x + 20),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment