]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Se agrega una pequeña mejora al dibujo de las lineas. Tengo pensado mejorarlas
authorRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 24 Nov 2003 00:48:04 +0000 (00:48 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 24 Nov 2003 00:48:04 +0000 (00:48 +0000)
 aun mas, pero tengo que pensar un poco el algoritmo.

Constructor/include/workplace.h
Constructor/src/workplace.cpp

index 41b6a22788a69097fd3918abfb8f43c7b994a6fc..004938b7df983472dc2ad566cdfcdbb24196881e 100644 (file)
@@ -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
index 548b771808d7a820885fc9774e11b1b93bbb292e..fd9b898375724df18178b01a854b711233024bdf 100644 (file)
@@ -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);
+}
+