Set opacity to 1 if none passed to fillColor and strokeColor

This commit is contained in:
Devon Govett 2014-02-16 11:49:09 -08:00
parent 0272b66e00
commit df43e0eeb0

View File

@ -65,14 +65,14 @@ module.exports =
op = if stroke then 'CS' else 'cs'
@addContent "/#{space} #{op}"
fillColor: (color, opacity) ->
fillColor: (color, opacity = 1) ->
set = @_setColor color, no
@fillOpacity opacity if set and opacity?
@fillOpacity opacity if set
return this
strokeColor: (color, opacity) ->
strokeColor: (color, opacity = 1) ->
set = @_setColor color, yes
@strokeOpacity opacity if set and opacity?
@strokeOpacity opacity if set
return this
opacity: (opacity) ->