Skip to content

Commit ce6d08f

Browse files
committed
rename a var to g2d
1 parent b83436c commit ce6d08f

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

lib/js/SequenceMessage.coffee

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
core = require "core.coffee"
22
pos = require "position.coffee"
3-
_g2d = require "g2d.coffee"
3+
g2d = require "g2d.coffee"
44
HTMLElement = require "HTMLElement.coffee"
55

66
class SequenceMessage extends HTMLElement
@@ -80,19 +80,12 @@ to_points = (vals)-> vals.map((e)-> "#{e[0]},#{e[1]}").join " "
8080
ahead = (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-
9689
SequenceMessage::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

140138
SequenceMessage::isToward = (dir) ->

0 commit comments

Comments
 (0)