0

I would like to have a rect centered on my body. This works for a circle :

draw.circle('200','50').fill('#f00').attr({ cx: '50%', cy: '50%' })

This not works :

draw.rect('200','50').fill('#f00').attr({ cx: '50%', cy: '50%' })
draw.rect('200','50').fill('#f00').move('50%','50%')

How to do this (without $(window).width()/2) ?

benoît
  • 1,473
  • 3
  • 13
  • 31

1 Answers1

0

Simply: You cant. To avoid clutter in the library the calls to move() only set the attribute on the element and dont do other magic. Since rectangles have no cx and cy you cant do it with the library alone.

Fuzzyma
  • 7,619
  • 6
  • 28
  • 60