From: Ricardo Markiewicz Date: Mon, 24 Nov 2003 00:48:04 +0000 (+0000) Subject: Se agrega una pequeña mejora al dibujo de las lineas. Tengo pensado mejorarlas X-Git-Tag: svn_import~186 X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/commitdiff_plain/8e0b92d947f09e5e4c00f49218aa1ba9ebc4dcb3?ds=inline Se agrega una pequeña mejora al dibujo de las lineas. Tengo pensado mejorarlas aun mas, pero tengo que pensar un poco el algoritmo. --- diff --git a/Constructor/include/workplace.h b/Constructor/include/workplace.h index 41b6a22..004938b 100644 --- a/Constructor/include/workplace.h +++ b/Constructor/include/workplace.h @@ -59,6 +59,8 @@ class WorkPlace:public Gtk::Fixed { ///Estado de diseño bool *logica; + protected: + void draw_line(int x1, int y1, int x2, int y2); }; #endif diff --git a/Constructor/src/workplace.cpp b/Constructor/src/workplace.cpp index 548b771..fd9b898 100644 --- a/Constructor/src/workplace.cpp +++ b/Constructor/src/workplace.cpp @@ -38,7 +38,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 +48,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 +161,10 @@ 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); +} +