11core = require " core.coffee"
22pos = require " position.coffee"
3- _g2d = require " g2d.coffee"
3+ g2d = require " g2d.coffee"
44HTMLElement = require " HTMLElement.coffee"
55
66class SequenceMessage extends HTMLElement
@@ -80,19 +80,12 @@ to_points = (vals)-> vals.map((e)-> "#{e[0]},#{e[1]}").join " "
8080ahead = (svg , sign , q )->
8181 dx = sign * 10
8282 dy = 6
83- e = _g2d .svg .new ' polyline' , class : " head" , points : to_points [[q .x + dx,q .y - dy], [q .x ,q .y ], [q .x + dx,q .y + dy]]
83+ e = g2d .svg .new ' polyline' , class : " head" , points : to_points [[q .x + dx,q .y - dy], [q .x ,q .y ], [q .x + dx,q .y + dy]]
8484 svg .appendChild e
8585
86- e = _g2d .svg .new ' polyline' , class : " closed" , points : to_points [[q .x + dx,q .y + (dy+ 1 )], [q .x + dx,q .y - (dy+ 1 )]]
86+ e = g2d .svg .new ' polyline' , class : " closed" , points : to_points [[q .x + dx,q .y + (dy+ 1 )], [q .x + dx,q .y - (dy+ 1 )]]
8787 svg .appendChild e
8888
89- g2d =
90- arrow : (svg , p , q )->
91- e = _g2d .svg .new ' line' , x1 : p .x , y1 : p .y , x2 : q .x , y2 : q .y
92- svg[0 ].appendChild e
93-
94- ahead svg[0 ], - 1 * (Math .sign q .x - p .x ), q
95-
9689SequenceMessage :: repaint = () ->
9790 shape = STEREOTYPE_STYLES[_determine_primary_stereotype this ]
9891 arrow = jQuery .extend {}, MESSAGE_STYLE, shape
@@ -113,7 +106,7 @@ SequenceMessage::repaint = () ->
113106 rcx = @ width () - (gap + 4 )
114107 rey = @ height () - (arrow .height / 2 + 4 )
115108 llw = @ _dstOccurr ().outerWidth ()
116- e = _g2d .svg .new ' polyline' , points : to_points [[llw/ 2 + gap, gap], [rcx, gap], [rcx, rey], [llw + gap, rey]]
109+ e = g2d .svg .new ' polyline' , points : to_points [[llw/ 2 + gap, gap], [rcx, gap], [rcx, rey], [llw + gap, rey]]
117110 svg[0 ].appendChild e
118111
119112 ahead svg[0 ], 1 , x : llw + gap, y : rey
@@ -134,7 +127,12 @@ SequenceMessage::repaint = () ->
134127 line .dst = a
135128 arrow .shape = ' dashed'
136129
137- g2d .arrow svg, line .src , line .dst , arrow
130+ arrow = (svg , p , q )->
131+ e = g2d .svg .new ' line' , x1 : p .x , y1 : p .y , x2 : q .x , y2 : q .y
132+ svg[0 ].appendChild e
133+ ahead svg[0 ], - 1 * (Math .sign q .x - p .x ), q
134+
135+ arrow svg, line .src , line .dst , arrow
138136 this
139137
140138SequenceMessage :: isToward = (dir ) ->
0 commit comments