[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Patch: better positions for UML component connections



Hello dia-maintainers,

I don't like having the western connection points of UML
components outside of the object.  Please consider accepting
this change.  Thanks!

      before        after

    * +-*---*      *--*--*
     _|_    |     _|_    |
    |___|   |    |___|   |
      |     |      |     |
    * |     *      *     *
     _|_    |     _|_    |
    |___|   |    |___|   |
      |     |      |     |
    * +-*---*      *--*--*

Cheers,
-- 
W. Borgert <debacle@debian.org>, Linux User #7456 http://counter.li.org/
--- dia.cvs/objects/UML/component.c	2003-08-14 12:08:02.000000000 +0000
+++ dia.facet/objects/UML/component.c	2003-08-17 09:05:04.000000000 +0000
@@ -59,7 +59,8 @@
 static void component_select(Component *cmp, Point *clicked_point,
 				DiaRenderer *interactive_renderer);
 static ObjectChange* component_move_handle(Component *cmp, Handle *handle,
-					   Point *to, HandleMoveReason reason, ModifierKeys modifiers);
+					   Point *to, HandleMoveReason reason,
+					   ModifierKeys modifiers);
 static ObjectChange* component_move(Component *cmp, Point *to);
 static void component_draw(Component *cmp, DiaRenderer *renderer);
 static Object *component_create(Point *startpoint,
@@ -306,17 +307,20 @@
 
   /* Update connections: */
   cmp->connections[0].pos = elem->corner;
-  cmp->connections[1].pos.x = elem->corner.x + elem->width / 2.0;
+  cmp->connections[0].pos.x += COMPONENT_CWIDTH/2.0;
+  cmp->connections[1].pos.x =
+    elem->corner.x + elem->width/2.0 + COMPONENT_CWIDTH/4.0;
   cmp->connections[1].pos.y = elem->corner.y;
   cmp->connections[2].pos.x = elem->corner.x + elem->width;
   cmp->connections[2].pos.y = elem->corner.y;
-  cmp->connections[3].pos.x = elem->corner.x;
+  cmp->connections[3].pos.x = elem->corner.x + COMPONENT_CWIDTH/2.0;
   cmp->connections[3].pos.y = elem->corner.y + elem->height / 2.0;
   cmp->connections[4].pos.x = elem->corner.x + elem->width;
   cmp->connections[4].pos.y = elem->corner.y + elem->height / 2.0;
-  cmp->connections[5].pos.x = elem->corner.x;
+  cmp->connections[5].pos.x = elem->corner.x + COMPONENT_CWIDTH/2.0;
   cmp->connections[5].pos.y = elem->corner.y + elem->height;
-  cmp->connections[6].pos.x = elem->corner.x + elem->width / 2.0;
+  cmp->connections[6].pos.x =
+    elem->corner.x + elem->width/2.0 + COMPONENT_CWIDTH/4.0;
   cmp->connections[6].pos.y = elem->corner.y + elem->height;
   cmp->connections[7].pos.x = elem->corner.x + elem->width;
   cmp->connections[7].pos.y = elem->corner.y + elem->height;
@@ -329,7 +333,7 @@
   cmp->connections[5].directions = DIR_SOUTH|DIR_WEST;
   cmp->connections[6].directions = DIR_SOUTH;
   cmp->connections[7].directions = DIR_SOUTH|DIR_EAST;
-                                                                                          
+
   element_update_boundingbox(elem);
 
   obj->position = elem->corner;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK