Commit 98cc6416 authored by Marcus Nordenberg's avatar Marcus Nordenberg

BUGFIX: Crash when trying to open context menu on connection in PLC editor

parent ce319ad9
...@@ -2941,8 +2941,16 @@ int WGre::undisplay() ...@@ -2941,8 +2941,16 @@ int WGre::undisplay()
// //
int WGre::node_select( vldh_t_node node) int WGre::node_select( vldh_t_node node)
{ {
flow_SelectInsert( flow_ctx, node->hn.node_id); /* Check if a connection is selected or not */
flow_SetHighlight( node->hn.node_id, 1); if (node->hn.vldhtype == VLDH_CON) {
flow_SelectInsert(flow_ctx, ((vldh_t_con)node)->hc.con_id);
flow_SetHighlight(((vldh_t_con)node)->hc.con_id, 1);
}
else {
flow_SelectInsert(flow_ctx, node->hn.node_id);
flow_SetHighlight( node->hn.node_id, 1);
}
return GRE__SUCCESS; return GRE__SUCCESS;
} }
...@@ -2952,8 +2960,16 @@ int WGre::node_select( vldh_t_node node) ...@@ -2952,8 +2960,16 @@ int WGre::node_select( vldh_t_node node)
// //
int WGre::node_unselect( vldh_t_node node) int WGre::node_unselect( vldh_t_node node)
{ {
flow_SelectRemove( flow_ctx, node->hn.node_id); /* Check if a connection is selected or not */
flow_SetHighlight( node->hn.node_id, 0); if (node->hn.vldhtype == VLDH_CON) {
flow_SelectRemove( flow_ctx, ((vldh_t_con)node)->hc.con_id);
flow_SetHighlight(((vldh_t_con)node)->hc.con_id, 0);
}
else {
flow_SelectRemove( flow_ctx, node->hn.node_id);
flow_SetHighlight( node->hn.node_id, 0);
}
return GRE__SUCCESS; return GRE__SUCCESS;
} }
......
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