[dia] Bug 697741 - FS (straight) flow label position adjusts incorrectly



commit 31ce2f1aedd7ecb371a21fc7b5b507c5c0d2ab81
Author: Hans Breuer <hans breuer org>
Date:   Fri Jul 26 22:46:17 2013 +0200

    Bug 697741 - FS (straight) flow label position adjusts incorrectly
    
    Actually two issues:
     - the adjustment was not correctly considering auto-gap
     - auto-gap with "FS - Function" was wrongly calculated due to
       bogus bounding box (have to adjust ElementBBExtras with
       every function_update_data())

 objects/FS/flow.c     |    1 +
 objects/FS/function.c |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/objects/FS/flow.c b/objects/FS/flow.c
index a20bbb5..bdbdb7d 100644
--- a/objects/FS/flow.c
+++ b/objects/FS/flow.c
@@ -257,6 +257,7 @@ flow_move_handle(Flow *flow, Handle *handle,
 
     connection_move_handle(&flow->connection, handle->id, to, cp, 
                           reason, modifiers);
+    connection_adjust_for_autogap(&flow->connection);
 
     p2 = endpoints[1] ;
     point_sub( &p2, &endpoints[0] ) ;
diff --git a/objects/FS/function.c b/objects/FS/function.c
index 45a9d6b..c9841f4 100644
--- a/objects/FS/function.c
+++ b/objects/FS/function.c
@@ -346,6 +346,7 @@ function_update_data(Function *pkg)
   
   text_calc_boundingbox(pkg->text, NULL) ;
   font_height = pkg->text->height ;
+  pkg->element.extra_spacing.border_trans = (font_height / FUNCTION_BORDERWIDTH_SCALE) / 2.0;
   h = elem->corner.y + font_height/FUNCTION_MARGIN_Y;
 
   if (pkg->is_user) {
@@ -460,7 +461,6 @@ function_create(Point *startpoint,
   }
   pkg->connections[8].flags = CP_FLAGS_MAIN;
 
-  pkg->element.extra_spacing.border_trans = FUNCTION_FONTHEIGHT / FUNCTION_BORDERWIDTH_SCALE/2.0;
   function_update_data(pkg);
 
   for (i=0;i<8;i++) {
@@ -583,7 +583,6 @@ function_load(ObjectNode obj_node, int version, DiaContext *ctx)
   }
   pkg->connections[8].flags = CP_FLAGS_MAIN;
 
-  pkg->element.extra_spacing.border_trans = pkg->text ? pkg->text->height : FUNCTION_FONTHEIGHT / 
FUNCTION_BORDERWIDTH_SCALE/2.0;
   function_update_data(pkg);
 
   for (i=0;i<8;i++) {


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