   rect.y2 = pt.y
   rect.centerX = getMiddlePos(rect.x1, rect.x2)
   rect.centerY = getMiddlePos(rect.y1, rect.y2)
-  obj.rect = rect
+  rect.bodyWidth = ctx.measureText(obj.body).width
+  return rect
 
 createIntersectionPoint = (instances, instanceOrder, messageOrder) ->
   result = new Object()

  result.bodyPoint = createMessageBodyPoint(obj.rect)
  return result

calcCanvasHeight = (messages) ->
  last = _.max(messages, (obj) -> obj.order)
  return unless last?
  height = INSTANCE_HEIGHT + MESSSAGE_OFFSET * (last.order + 2)
  height += CANVAS_PADDING * 2
  return height

calcCanvasWidth = (ctx, instances) ->
  last = _.max(instances, (obj) -> obj.order)
  return unless last?
  x = getInstanceMargin(ctx, instances, messages, last)
  width = CANVAS_PADDING * 2 + last.rect.x + last.rect.width + x
  return width

fillBackground = (ctx, width, height) ->
  ctx.fillStyle = "white"
  ctx.fillRect(0, 0, width, height)
  ctx.fillStyle = "black"

# ------------------------------


  bodyPt = obj.normalMessage.bodyPoint
  drawMessageLine(ctx, obj.rect, obj.is_return)
  drawMessageArrowhead(ctx, headPt, isHeadLeft(obj))
  drawMessageText(ctx, bodyPt.x, bodyPt.y, obj.rect.bodyWidth, obj.body)

isHeadLeft = (obj) ->
  obj.to.order <= obj.from.order
