1

i am using raphael.js to draw free hand drawing in ipad. it works but the curves or path i am drawing is not smooth and its not fast. the curves appear to be like polygonal. pl help me how to sort this out in ipad.the code i am using to draw is

paper = Raphael(document.getElementById('loadOnPdf'),780,1500);
masterBackground =paper.image("image1.jpg",0,0,780,1500);
masterBackground.touchmove(function (event)
{
  var evt = event;
  var IE = document.all?true:false;  
  var x,y;                                                                                       
  x = evt.changedTouches[0].clientX;  
  y=evt.changedTouches[0].clientY;                                                                     this.ox = x;
 this.oy = y;
});                                
 var start = function () {
 g_masterPathArray = new Array();
 };
 var move = function (dx, dy) {
 if (g_masterPathArray.length == 0) {
 g_masterPathArray[0] = ["M",this.ox,this.oy];
 g_masterDrawingBox = paper.path(g_masterPathArray);
g_masterDrawingBox.attr({id:"path",stroke: colour,"stroke-width": 10});                                                      
 }
 else
 gmasterPathArray[g_masterPathArray.length] =["L",this.ox,this.oy];
 g_masterDrawingBox.attr({path: g_masterPathArray});
 };
4

0 回答 0