From d0b84f85956a5e0ea02474b530902cf3505ac46b Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Fri, 15 Jul 2011 23:20:46 -0400 Subject: [PATCH] Make list method use current x and y position by default and reset x position at the end. --- lib/mixins/text.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mixins/text.coffee b/lib/mixins/text.coffee index 463f424..23901ba 100644 --- a/lib/mixins/text.coffee +++ b/lib/mixins/text.coffee @@ -60,14 +60,17 @@ module.exports = @y -= @currentLineHeight(true) * lines + @_lineGap return this - list: (array, @x, @y) -> + list: (array, ox, oy) -> gap = Math.round (@_font.ascender / 1000 * @_fontSize) / 2 + @x = x = ox or @x + @y = y = oy or @y for item in array @circle x + 3, @y + gap + 3, 3 @text item, x + 15 @y += 3 - + + @x = x @fill() _escape: (text) ->