From 8e0b92d947f09e5e4c00f49218aa1ba9ebc4dcb3 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Mon, 24 Nov 2003 00:48:04 +0000 Subject: [PATCH] =?utf8?q?=20Se=20agrega=20una=20peque=C3=B1a=20mejora=20a?= =?utf8?q?l=20dibujo=20de=20las=20lineas.=20Tengo=20pensado=20mejorarlas?= =?utf8?q?=20=20aun=20mas,=20pero=20tengo=20que=20pensar=20un=20poco=20el?= =?utf8?q?=20algoritmo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Constructor/include/workplace.h | 2 ++ Constructor/src/workplace.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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); +} + -- 2.43.0