Merge pull request #166 from Radagaisus/patch-1

Morris Fails to Compile with the Closure Compiler
This commit is contained in:
Olly Smith 2013-01-24 13:03:59 -08:00
commit 18a4e8923a

View file

@ -119,7 +119,7 @@ class Morris.DonutSegment extends Morris.EventEmitter
@cos_p0 = Math.cos(p0) @cos_p0 = Math.cos(p0)
@sin_p1 = Math.sin(p1) @sin_p1 = Math.sin(p1)
@cos_p1 = Math.cos(p1) @cos_p1 = Math.cos(p1)
@long = if (p1 - p0) > Math.PI then 1 else 0 @is_long = if (p1 - p0) > Math.PI then 1 else 0
@path = @calcSegment(@inner + 3, @inner + @outer - 5) @path = @calcSegment(@inner + 3, @inner + @outer - 5)
@selectedPath = @calcSegment(@inner + 3, @inner + @outer) @selectedPath = @calcSegment(@inner + 3, @inner + @outer)
@hilight = @calcArc(@inner) @hilight = @calcArc(@inner)
@ -136,16 +136,16 @@ class Morris.DonutSegment extends Morris.EventEmitter
[ox0, oy0, ox1, oy1] = @calcArcPoints(r2) [ox0, oy0, ox1, oy1] = @calcArcPoints(r2)
return ( return (
"M#{ix0},#{iy0}" + "M#{ix0},#{iy0}" +
"A#{r1},#{r1},0,#{@long},0,#{ix1},#{iy1}" + "A#{r1},#{r1},0,#{@is_long},0,#{ix1},#{iy1}" +
"L#{ox1},#{oy1}" + "L#{ox1},#{oy1}" +
"A#{r2},#{r2},0,#{@long},1,#{ox0},#{oy0}" + "A#{r2},#{r2},0,#{@is_long},1,#{ox0},#{oy0}" +
"Z") "Z")
calcArc: (r) -> calcArc: (r) ->
[ix0, iy0, ix1, iy1] = @calcArcPoints(r) [ix0, iy0, ix1, iy1] = @calcArcPoints(r)
return ( return (
"M#{ix0},#{iy0}" + "M#{ix0},#{iy0}" +
"A#{r},#{r},0,#{@long},0,#{ix1},#{iy1}") "A#{r},#{r},0,#{@is_long},0,#{ix1},#{iy1}")
render: (r) -> render: (r) ->
@arc = r.path(@hilight).attr(stroke: @color, 'stroke-width': 2, opacity: 0) @arc = r.path(@hilight).attr(stroke: @color, 'stroke-width': 2, opacity: 0)