X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/d4d9e7169ed68ba75024ab23f773fbb168ef2e55..101179f2d7bcc4de75c326d3e9d01694c84d07ca:/Constructor/src/workplace.cpp?ds=sidebyside diff --git a/Constructor/src/workplace.cpp b/Constructor/src/workplace.cpp index 548b771..94e3934 100644 --- a/Constructor/src/workplace.cpp +++ b/Constructor/src/workplace.cpp @@ -26,6 +26,7 @@ bool WorkPlace::on_expose_event(GdkEventExpose *event) if ( *logica ) { std::list::iterator j = listaItems->begin(); while ( j != listaItems->end() ) { + (*j)->update_logic_position(); (*j)->draw_connectors(); j++; } @@ -38,7 +39,7 @@ bool WorkPlace::on_expose_event(GdkEventExpose *event) if ( get_item(temp.store_id) != NULL && get_logic_item(temp.logic_id) != NULL ) { get_item(temp.store_id)->get_in_logic_connect_position(w,z); get_logic_item(temp.logic_id)->get_out_logic_connect_position(a, b); - get_window()->draw_line (get_style()->get_black_gc(), a, b, w,z); + draw_line(a, b, w,z); } i++; } @@ -48,7 +49,7 @@ bool WorkPlace::on_expose_event(GdkEventExpose *event) if ( get_item(temp.store_id) != NULL && get_logic_item(temp.logic_id) != NULL ) { get_item(temp.store_id)->get_out_logic_connect_position(w,z); get_logic_item(temp.logic_id)->get_in_logic_connect_position(a, b); - get_window()->draw_line (get_style()->get_black_gc(), a, b, w, z); + draw_line(w, z, a, b); } i++; } @@ -161,3 +162,9 @@ void WorkPlace::update_logic_position() i++; } } + +void WorkPlace::draw_line(int x1, int y1, int x2, int y2) +{ + get_window()->draw_line (get_style()->get_black_gc(), x1, y1, x1, y2); + get_window()->draw_line (get_style()->get_black_gc(), x1, y2, x2, y2); +}