diff -ru dia-0.90/objects/UML/association.c dia-0.90.os/objects/UML/association.c
--- dia-0.90/objects/UML/association.c	Sat Feb  2 00:21:56 2002
+++ dia-0.90.os/objects/UML/association.c	Wed Jun  5 18:42:31 2002
@@ -144,6 +144,7 @@
 				const char *filename);
 
 static void association_update_data(Association *assoc);
+static coord get_aggregate_pos_diff(AssociationEnd *end);
 
 static ObjectTypeOps association_type_ops =
 {
@@ -487,14 +488,25 @@
   end->text_pos = points[0];
   switch (assoc->orth.orientation[0]) {
   case HORIZONTAL:
-    end->text_pos.y -= font_descent(assoc_font, ASSOCIATION_FONTHEIGHT);
-    if (points[0].x < points[1].x)
+    if (points[0].x < points[1].x) {
       end->text_align = ALIGN_LEFT;
-    else
-      end->text_align = ALIGN_RIGHT;
+      end->text_pos.x += get_aggregate_pos_diff(end);
+    } else {
+      end->text_align = ALIGN_RIGHT;    
+      end->text_pos.x -= get_aggregate_pos_diff(end);
+    }
     break;
   case VERTICAL:
     end->text_pos.y += font_ascent(assoc_font, ASSOCIATION_FONTHEIGHT);
+    if (points[0].y > points[1].y) {
+      if (end->role!=NULL)
+	end->text_pos.y -= ASSOCIATION_FONTHEIGHT;
+      if (end->multiplicity!=NULL)
+	end->text_pos.y -= ASSOCIATION_FONTHEIGHT;
+      end->text_pos.y -= get_aggregate_pos_diff(end);
+    } else {
+      end->text_pos.y += get_aggregate_pos_diff(end);
+    }
     end->text_align = ALIGN_LEFT;
     break;
   }
@@ -513,10 +525,13 @@
   switch (assoc->orth.orientation[n-1]) {
   case HORIZONTAL:
     end->text_pos.y -= font_descent(assoc_font, ASSOCIATION_FONTHEIGHT);
-    if (points[n].x < points[n-1].x)
+    if (points[n].x < points[n-1].x) {
       end->text_align = ALIGN_LEFT;
-    else
+      end->text_pos.x += get_aggregate_pos_diff(end);
+    } else {
       end->text_align = ALIGN_RIGHT;
+      end->text_pos.x -= get_aggregate_pos_diff(end);
+    }
     break;
   case VERTICAL:
     end->text_pos.y += font_ascent(assoc_font, ASSOCIATION_FONTHEIGHT);
@@ -525,6 +540,9 @@
 	end->text_pos.y -= ASSOCIATION_FONTHEIGHT;
       if (end->multiplicity!=NULL)
 	end->text_pos.y -= ASSOCIATION_FONTHEIGHT;
+      end->text_pos.y -= get_aggregate_pos_diff(end);
+    } else {
+      end->text_pos.y += get_aggregate_pos_diff(end);
     }
     end->text_align = ALIGN_LEFT;
     break;
@@ -536,6 +554,23 @@
   rect.bottom = rect.top + 2*ASSOCIATION_FONTHEIGHT;
   
   rectangle_union(&obj->bounding_box, &rect);
+}
+
+static coord get_aggregate_pos_diff(AssociationEnd *end)
+{
+  coord width=0;
+  if(end->arrow){
+    width = ASSOCIATION_TRIANGLESIZE;
+  }
+  switch(end->aggregate){
+  case AGGREGATE_COMPOSITION:
+  case AGGREGATE_NORMAL:
+    if(width!=0) width = MAX(ASSOCIATION_TRIANGLESIZE, ASSOCIATION_DIAMONDLEN);
+    else width = ASSOCIATION_DIAMONDLEN;
+  case AGGREGATE_NONE:
+    break;
+  }
+  return width;
 }
 
 static Object *
