Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 0.39 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Raphael.js text positioning problem when scaling
  2. var paper = Raphael("mycanvas", '100%', '100%');
  3.  
  4. var myRect = paper.rect(40, 40, 50, 50, 10);
  5. var myText = paper.text(50, 50, "Raphaƫlnkicksnbutt!").attr('text-anchor', 'start');
  6.  
  7. var clickEvt = function(){
  8.     myRect.scale(0.8, 0.8, 0, 0);
  9.     myText.scale(0.8, 0.8, 0, 0);
  10.  
  11. }
  12.  
  13. var myBtn = paper.rect(140, 10, 30, 30);
  14. myBtn.click(clickEvt);